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

Deleting one or multiple rows in a DataBoundGrid

Thread ID:





5472 Jul 3,2003 06:29 PM UTC Jul 7,2003 04:33 PM UTC WinForms 3
Tags: GridControl
Jose M. Gonzalez
Asked On July 3, 2003 06:29 PM UTC

Attached is a simple example I have created to test the deletion of one or multiples rows. I have seen some of the examples provided in this forum, but for some reason, it is not working as I expect. Basically after I select multiple rows the gridDataBoundGrid.Selections.Ranges.ActiveRange property is not returning any selection. Also I'm not able to cancel the Handler if the selection can not be deleted. What am i doing wrong? Thanks in advance. Jose.

Administrator [Syncfusion]
Replied On July 3, 2003 09:17 PM UTC

The default behavior of the grid is to delete rows if you select a row range, and press the delete key. In your code, what is happening is that the rows have already been deleted by the time your RemoveRows() method is called, so the selected range has been removed. Hence, the range you get is empty. You can see this by commenting out your CurrentCellKeyDown code, so your RemoveRows is never called, but the selected rows will be removed anyway.

Jose M. Gonzalez
Replied On July 7, 2003 03:54 PM UTC

Oooooopppsss! Got it. What do you recommend if I need to show a confirmation message before the user deletes one or more rows? Thanks

Administrator [Syncfusion]
Replied On July 7, 2003 04:33 PM UTC

You can use the RowsDeleting event. It is cancelable.


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