Hello;
I'm using the _BeforeRowUpdate grid event to validate data the user has entered and if it's found to be invalid, I show a messagebox indicating the invalid data problem and activate the appropriate row and cell and do a PerformAction:
e.Row.Activate();
theCell.Activate();
this.myGird.PerformAction(UltraGridAction.EnterEditMode);
This works fine unless the user is working in the add row, in which case the row that ends up being activated is the last row of the grid. I've spent a bit of time tracing code, adding debug statements, trying eveything I can think of, but I can't figure this out.
Thanks,
Bill
Hi Bill,
I'm surprised this code works for any row. You are essentially activating the same row that is already active. I think what you need to do is set the BeforeRowUpdateCancelAction property on the grid. Then just set e.Cancel inside BeforeRowActivate. This should allow you to prevent the row from losing focus. You will still want to activate the cell and enter edit mode, I think.