I have a webgrid in my form in which some of my columns are editable and some are not editable. Now I want to disable columns which are not editable.
Following is the code for WinUltraGrid. I want to do same thing in my webversion also.
void EditMode(bool enabled)
{
for (int i = 0; i < reportUltraGrid.DisplayLayout.Bands[0].Columns.Count; i++)
reportUltraGrid.DisplayLayout.Bands[0].Columns[i].CellActivation = (enabled
?
Activation.Disabled
:
Activation.NoEdit);
}
Thanks
WebGrid does not have the concept of a "disabled" cell, row, or column, not in the same way that WinGrid has.
To simulate this "disabled" effect, set the CellStyle properties of your column to "gray out" or otherwise adjust the appearance of the column. To prevent the user from editing values in the column, set that column's AllowUpdate property to No (Infragistics.WebUI.UltraWebGrid.AllowUpdate.No if doing so in code).