We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Do not allow to delete and add new row in DataGrid ?

I have a datagrid that is bound to a table. I want the data displayed and allow the user to select and edit a record. But I don't want the blank last row displayed and cancel any delete. I don't want them to be able to enter new Row in this datagrid. only for editting and update!! Thanks for any help

1 Reply

MI mike November 14, 2003 12:58 PM UTC

You control that through the active DataView associated with the DataGrid. If you haven't created your own customer dataview then there is a default one used available by: dgMyGrid.DefaultView the DataView has properties which control what the user can and can't do with the grid. Eg... //[C#] - Allowing a user to only delete // from a list DataView dv = dgMyGrid.DefaultView; dv.AllowDelete = true; dv.AllowEdit = false; dv.AllowNew = false; cheers, MM

Live Chat Icon For mobile
Up arrow icon