I want to update the control Rating in disabled if bit Evaluacion is false, but there is no action. I use the HtmlDataCellPrepared property to modify the column but I can not make it a column disabled, I need to disable the control but I do not know how I could do it.
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;
}
}
};
Control is still enabled after the bitEvaluacion cell is set to "True"