如果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;
}
}
};