Disable Delete Row in Windows datagrid

  • Thread starter Thread starter Joe Lalor
  • Start date Start date
J

Joe Lalor

I want to disable row deletion in a Windows form
datagrid. I have tried using the row_changed/row_deleted
events for the datasource to reject changes for the row :
this prevents the row from being deleted from the table,
but it disappears from the grid.
 
Joe,

Create a dataview from dataset. Bind the datagrid to the dataview.
Set the dataview allowdelete property to false.

Ken
 
Back
Top