Hi,
Can someone suggest me how to add rowediting and adding columnsettings in codebehind. I tried with the following code but it failed
RowAddingColumnSetting setting1 = new RowAddingColumnSetting(WebDataGrid1); setting1.ColumnKey = readonlyColumns[i].ToString(); setting1.ReadOnly = true; WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(setting1);
the last line gives error saying Object reference not set to an instance of an object.....
:(((((
The first thing that I notice about your code is that you are instantiating a RowAddingColumnSetting, but are adding that to the Column Settings for Cell Editing. If you want a setting for cell editing, you need to create a EditingColumnSetting. Also, make sure that your behaviors are created, either on the apsx or in code behind, before trying to add the setting. Let us know if you have further troubles.
regards,David Young