Hi Guys,
I am trying to disable a column when I click on "Edit" command. In my grid, the Edit command is autogenerated and columns are also autogenerated.
I want to disable a column when I click on "Edit" link. However, the column remains enabled and editable. Can anyone please let me know what am I doing wrong. Following is the code:
I am trying to disable a column when I click on "Edit" command. In my grid, the Edit command is autogenerated and columns are also autogenerated.
I want to disable a column when I click on "Edit" link. However, the column remains enabled and editable. Can anyone please let me know what am I doing wrong. Following is the code:
protected void RadGrid_EditCommand(object sender, GridCommandEventArgs e)
{
GridDataItem dataItem = e.Item as GridDataItem;
var column = RadGrid.MasterTableView.AutoGeneratedColumns.First(i => i.HeaderText == "Name");
dataItem[column].Enabled =
false;
}