One way is to create a dataview based on the table and bind the grid to the
view. This will allow you to do a lot of filitering and sorting easily
DataView dv = DataSetName.Tables[TableIndex].DefaultView;
then set the allowDelete property to false
dv.AllowDelete = false;
then bind the grid to the view. AFIAK, this is the only way if you still
want to allow editing. Another thing you could do it use HitTest and then
cancel any attempt to delete a row, but I think the Dataview is easier. The
DataGridTableStyle has a ReadOnly property that may be helpful for other
things, but it won't let you edit so that won't help here.
HTH,
Bill
Mauricio said:
Hi, is there a way to prevent user from selecting DataGrid's single rows
and deleting them, but I still need to edit the rows?