A DataTable does not allow this setting. To achieve this, you need to change the way you are data binding the table to the ListObject.
Instead of specifying the DataTable as the DataSource for the BindingSource, you need to create a DataView object over the DataTable. A DataView allows setting the AllowDelete property and you can set this to false. Then specify this DataView as the DataSource for the BindingSource.
Thanks.
This posting is provided "AS IS" with no warranties, and confers no rights. |