Hello,
This is probably something easy but I can't find it.
We have a grid, and that grid is using AfterCellUpdate event to update an email address. That grid is in a tab control. When you change tabs, the datasource changes (or filters the list) to reflect data that is important to the tab.
The issue is that AfterCellUpdate does not fire when clicking on a new tab. I tried to use a few events (Leave, ExitEditMode, etc).
Thanks,
M.
Hello Michael,
I have been investigating into the behavior you are seeing, and I am under the impression that you mean that you are in edit mode when you switch tabs, and it is not firing the AfterCellUpdate. I have tried testing this against version 2021.2 of the Infragistics for Windows Forms toolset, but this event is firing correctly on my end.
I am attaching a sample project that demonstrates this. If you can please modify it and send it back such that it reproduces the behavior you are seeing, I will gladly take a look. Alternatively, if you have a sample project of your own that demonstrates this that you can attach, I can take a look at that instead.
Please let me know if you have any other questions or concerns on this matter.
UltraGridTabControlTest.zip
Thanks. One difference is that we are using an UltraTab, in a userControl in a split panel. But I went back and tested more and it seems to be working correctly in our application. I am sorry to have taken you time on this, but you did help confirm that it should work I think we tracked it down to being an async thing.
One other question : We have an ultratoolbarmanager docked to the shared controls page of that tab control. When the control first loads, there are no tabs (they get added as a user clicks on a tree control on the left side of the split container. The shared control page does not show until you click the first tab. Is there a way to have it show when it first loads?
I am glad that the AfterCellUpdate event is working correctly in your application.
Regarding the UltraToolbarsManager, it sounds like you have a setup where the tabs load based on what is selected in the tree control and you are populating the tabs programmatically / dynamically? If this is the case, you could simply add a tab in the designer or perhaps programmatically when the corresponding tab is selected, so to act as a placeholder of sorts?
Thanks. That is what we thought to do, but wanted to make sure there was not some setting that controls this. Interesting is that when you remove all the tabs, the shared tab shows with the toolbar manager. It is only the default starting state.
Back to the other issue, just as an FYI. We have an async method being awaited in the after cell update event handler. The issue is, that when you go from the cell to changing the tab, once it hits the async method control it goes right the tab changed event, which refreshes the datasource...the same one that is being updated.I don't want to block the task, so not sure how to handle. Not really your issue, but just thought if anyone else was going to see this question they could understand better the problem.
Thank you for your update on this matter. I am not entirely sure what you mean by the “shared tab” in this case, but perhaps I am missing something about the rendering of the UltraToolbarsManager. Perhaps something you could do is add an initial “placeholder” tab and then remove it programmatically, so it still shows this “shared tab”?
Regarding your other behavior, when you await an async method, this does not really stop the UI thread from continuing its execution. Effectively when you await something, it will return from the current code block and essentially rewrite your code into a state machine that does the work of chaining tasks, so that the code in the current method executes after the await completes. Perhaps something you could do in the AfterCellUpdate handler in this case is check the tab that is selected prior to your await method, as I would not expect that to have been updated yet, and then if it is not the same after your await method completes, you could do the refresh of the data source there?