Controling Datagrid editing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Is there a way to allow user to edit a column in the datagrid, and still not allow him to delete or add rows?Thank you
Sam
 
Sam,

Yes, there is. When you bind a table to the DataGrid, you are not
binding to the table, but to the DataView exposed by the DefaultView
property. What you want to do is create a new DataView instance, and set
the AllowNew and AllowDelete properties to false, while the AllowEdit
property is true. Once you do that, bind to the DataView, and you will get
the functionality you are looking for.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Sam said:
Hi,
Is there a way to allow user to edit a column in the datagrid, and still
not allow him to delete or add rows?Thank you,
 
Back
Top