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
1375
Cancel a cell update if grid header is clicked
posted

I'm trying to figure a way to cancel the update of a cell, restoring the original values, if the grid header is clicked for any reason (sorting, moving, etc).

What I've attempted is trapping the MouseDown event and checking to see if the HeaderUIElement was clicked but it seems that both the BeforeExitEditMode and BeforeCellUpdate events fire as soon as the header is being clicked and before the MouseDown event fires.

I haven't found any other way of determining what is causing the BeforeCellUpdate so I could conditionally cancel the update.

Any help would be appreciated.

Regards,

Jim

Parents
  • 17259
    Offline posted

    BeforeCellUpdate is fired when the cell loses focus, so obviously it is before the mousedown for the header.

    You can save the cell old value in the BeforeCellUpdate event, and after the mousedown restore it by setting the old value back. Just don't forget to disable the BeforeCellUpdate event when you set the value because it will fire again. You can do it with the grid EventManager.

Reply Children