【问题标题】:Disable checkbox in Telerik Grid in MVC在 MVC 中的 Telerik Grid 中禁用复选框
【发布时间】:2012-09-03 07:44:53
【问题描述】:

是否可以在 MVC 模式的 Telerik gridview 中禁用复选框? 我正在使用 clientTemplate 而不是服务器端。 要求为 - 需要根据相应行中另一列中的值禁用包含复选框的列。 是否可以在 Javascript 中实现?如果我不清楚,请告诉我..

提前谢谢..

columns.Bound(i => i.Visible).ClientTemplate("<input type='checkbox' disabled='disabled' <#=Visible? checked='checked' : '' #> />").Width("7%");

【问题讨论】:

    标签: asp.net-mvc asp.net-mvc-3 telerik telerik-grid client-side-templating


    【解决方案1】:

    您可以在 RowDataBound 时使用客户端事件执行此操作。执行类似此代码的操作。

        function onRowDataBound(e) {
    
        if (e.dataItem.ColumnB == "MatchingValue") {
            $(e.row).find('#checkboxId').attr("disabled", true);
    
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-18
      • 2013-09-21
      • 2012-07-12
      • 2018-09-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多