Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
row deletion in ultrawingrid
posted

is there a way to supress default row deletion.

I have a scenario where when a group of rows are selected and delete key pressed, I need to delete some and keep some based on some condition.

 

Thanks

  • 69832
    Suggested Answer
    Offline posted

    The control exposes a BeforeRowsDeleted event, but it looks like it was designed for all-or-nothing cancellation, i.e., you can cancel the event, preventing the deletion altogether, but you cannot manipulate the array of Rows provided by the event arguments.

    One way to work around this limitation would be to handle the event, cancel it, and then use BeginInvoke to call a method asynchronously that deletes only the rows you want to remove. You would also have to set a flag in the BeforeRowsDeleted handler so you know not to cancel it the second time it fires.