如何在GridView列中更新Rating Control?

时间:2017-07-06 15:58:37

标签: c# asp.net-mvc gridview devexpress-mvc

如果CALacion位为false,我想更新禁用的控件等级,但是没有动作。我使用HtmlDataCellPrepared属性来修改列,但我不能禁用它,我需要禁用控件,但我不知道怎么做。

settings.Columns.Add(column =>
    {
        column.Name = "Evaluacion";
        column.Caption = "Evaluacion";
        column.SetDataItemTemplateContent(container =>
        {
            @Html.DevExpress().RatingControl(linkSettings =>
           {
               linkSettings.Name = "RatingControl_" + container.KeyValue;
               linkSettings.ClientSideEvents.ItemClick = "function(s, e){ Eval(s, e, " + container.KeyValue + "); }";
               linkSettings.Enabled = true;
           }).GetHtml();
        });
    });
    settings.Columns.Add(column =>
    {
        column.FieldName = "bitEvaluacion";
    });
    settings.HtmlDataCellPrepared = (sender, e) =>
    {
        if (e.DataColumn.Name == "Evaluacion")
        {
            bool bitEvaluacion = Convert.ToBoolean(e.GetValue("bitEvaluacion"));
            if (bitEvaluacion == false)
            {
                e.DataColumn.ReadOnly = true;
                e.Cell.Enabled = false;
            }
        }
    };

bitEvaluacion单元格设置为" True"后仍然启用控制。 Control is still enabled after the bitEvaluacion cell is set to "True"

0 个答案:

没有答案