Hi
I would like to implement a multiple rows deletion mechanism which would prompt the user to continue or to stop the deletion of remaining rows (if any) in case one row deletion failed (due to business rule).
The issue I encounter is that using _ultraGridList.DeleteSelectedRows(); I cannot know in the delete event if some rows remain to be deleted.
protected virtual void source_RowDeleting(object sender, RowDeletingEventArgs e){ if (!DeleteData(e.Row.Tag)) e.Cancel = true;
}
Any ideas
Thanks in advance
Hi Franck,
There's no way to know on the UltraDataSource if more than one row is being deleted. The grid only deals with the data source via the IBindingList implementation and this interface doesn't have any method to delete more than one row at a time.
So the only way to do this would be to use the BeforeRowsDeleted event of the grid.
I am using the RowDeleting event of the grid underlying UltraDataSource.The event is triggered for each delete rows and I can even prevent the row to be deleted using RowDeletingEventsArgs Cancel property but I would like to find an easy way to know within this event the total number of row to be deleted and what how many remain to be deleted.
I guess I will have to implement a counter ?
Thanks
Franck
Hi,
What event are you using here? This doesn't look like an event on the grid. The grid has no event for deleting a single row, the grid event for deleting rows is BeforeRowsDeleted and this event gives you the whole list of rows, not just one.