I have some old code from UltraWebGrid that sets a column as being updatable. I am curious if there is any sample code out there that shows how to update a column on a WebHeirarchicalDataGrid or a WebDataGrid as being UPDATEABLE?
Thanks,
Wayne
Hello Wayne,
In order to make a column editable, you would need to add the Editing Core and Cell Editing behaviors to the Behaviors collection to the grid. Below you can find a documentation page for both the WebDataGrid and the WebHierarchicalGrid:
Cell Editing (WebDataGrid)
Cell Editing (WebHierarchicalDataGrid)
For the WebHierarchicalDataGrid you have two options, you can either set a behaviors collection for the parent and the child bands or use one bahaiors collection and set the EnableInheritance property to true so that the child band inherits all the behaviors of the parent band. Note the EnableInheritance need to be set on each behavior separately, the only behaviors that doesn’t require this property are Activation and Selection.
In case you would to make a column Read-Only you can do this by adding a ColumnSettings collection, where the ReadOnly property of the column is set to true.
Below you can find samples for both the WebDataGrid as well as the WebHierarchicalDataGrid that demonstrate the CellEditing behavior:
https://es.infragistics.com/samples/aspnet/data-grid/editing-rows-basic-features
https://es.infragistics.com/samples/aspnet/hierarchical-data-grid/edit-parent-band
A column could also be made Read-Only in code behind as well, an example could be found in this forum post.
Please let me know if you have any questions.
Regards, Ivan Kitanov