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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top