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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid Prevent delete of a specific row

Thread ID:

Created:

Updated:

Platform:

Replies:

52994 Dec 6,2006 10:14 PM UTC Dec 7,2006 04:21 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 6, 2006 10:14 PM UTC

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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On December 7, 2006 04:21 PM UTC

Thanks, that worked.

CONFIRMATION

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.

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

;