The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
ADAdministrator Syncfusion Team 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.
JMJose M. GonzalezJuly 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
ADAdministrator Syncfusion Team July 7, 2003 04:33 PM UTC
You can use the RowsDeleting event. It is cancelable.