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

GridDataBoundGrid Prevent delete of a specific row

Thread ID:





52994 Dec 6,2006 05:14 PM Dec 7,2006 11:21 AM Windows Forms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On December 6, 2006 05:14 PM

I am using a GridDataBoundGrid, and am wondering if there is a way to prevent a user from deleting a single row (but they can still delete the rest).

I.E. they are configuring default values in the first row, and overriding them in additional rows, but I don't want the user to be able to delete the first row.


Administrator [Syncfusion]
Replied On December 6, 2006 11:17 PM

Hi Michael,

There is a property to control the removing the record from GridDataBoundGrid if the underlying datasource allows it. you can specify this by using Binder.EnableRemove property. You can subscribe the Binder.CurrentPositionChanged event at the top of the form and set Binder.EnableRemove to false for first record.

private void Binder_CurrentPositionChanged(object sender, EventArgs e)
GridModelDataBinder binder = sender as GridModelDataBinder;
binder.EnableRemove = binder.CurrentPosition != 0;

Best Regards,

Administrator [Syncfusion]
Replied On December 7, 2006 11:21 AM

Thanks, that worked.


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.

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.