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.
ADAdministrator Syncfusion Team July 3, 2003 04:17 PM
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.
JMJose M. GonzalezJuly 7, 2003 10:54 AM
Oooooopppsss! Got it.
What do you recommend if I need to show a confirmation message before the user deletes one or more rows?
ADAdministrator Syncfusion Team July 7, 2003 11:33 AM
You can use the RowsDeleting event. It is cancelable.