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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





7201 Sep 16,2003 07:52 AM UTC Nov 14,2003 12:58 PM UTC WinForms 1
Tags: FAQ
Asked On September 16, 2003 07:52 AM UTC

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

Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon