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
410
Focus leaving the grid and infinite error msgbox
posted

I have a cell with a dropdown and when I make a selection then move off of the grid by say, clicking on a button outside of the grid, I get an error because the cell failed to validate the new selection.  an error msgbox shows up but when I dismiss it, the msgbox pops up again and there is nothing i can do other than kill the app.

It seems like when I dismiss the msgbox, the app wants to move the focus to the button but the cell fails to validate again and thus pops up the msgbox again and again.

It'd be nice if I could either prevent the focus to be moved away until everything is valid or somehow move the focus back to the grid after the initial error msgbox showing up.


What options are there?

  • 469350
    Offline posted

    Hi,

    What version of the grid are you using? This sounds to me like a known bug that was fixed a while ago. Try getting the latest service release and see if that helps:

    How to get the latest service release - Infragistics Community

    If I'm wrong and that does not help, see if you can reproduce the problem in a small sample project and post it here so I can take a look.

  • 410
    Offline posted

    I just tried setting e.Cancel = true in BeforeExitEditMode and the grid basically seems to go into an infinite loop and now the app is practically frozen and I have to kill the app.


    The best option if possible would be to be able to detect whether focus is leaving the grid in either CellDataError or Error event handlers, then if the focus is leaving the grid, restore original value but otherwise, stay in edit mode with the focus back to the cell.  All that with the least amount of code/change. :)

    The reason I insist on CellDataError, for example, instead of BeforExitEditMode, is then I won't have to modify my business objects at all.  I don't have to add IsValid property or Validate method, etc.  The grid would have tried to update the object by the time CellDataError is hit by simple Property assignment, and I didn't even have to manually do that in BeforeExitEditMode.  Does that make sense?