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

GridDataBoundGrid Prevent delete of a specific row

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.

Thanks

2 Replies

AD Administrator Syncfusion Team December 7, 2006 04:17 AM UTC

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,
Haneef


AD Administrator Syncfusion Team December 7, 2006 04:21 PM UTC

Thanks, that worked.

Loader.
Live Chat Icon For mobile
Up arrow icon