Hi,
I have the following situation: on a form there are two WinGrids, one showing the child rows of the row selected in the other. After adding a new row in the master grid the child grid should be made active so the data entry could continue in it. When the data in a row is modified the focus should remain in the master grid.
To edit the rows in the master grid I am using RowEditTemplates. New rows are added via an Add Row at the top of the grid.
I was trying to move the focus on the child grid in the AfterRowUpdate on the master grid, but this event was raised before AfterRowEditTemplateClosed after which the newly added row was selected again, so the master grid regained the focus.
Then I have tried to move the focus to the child grid in the AfterRowEditTemplateClosed event handler, but again the newly added row was selected, and the master grid regained the focus.
Which is the order in which the events related to a row being added or updated are raised? Which event should I use so I can move the focus to the child grid when a new row is commited to the master grid?
Thanks,
Emanuel
Thanks Mike, it works. Looks like I have to learn a little bit more...
Hi Emanuel,
What I would do is try using a BeginInvoke to call a method that sets focus to the child grid, rather than doing it directly inside the event.