Is there a way to identify when a XamGrid has been fully rendered and all data is loaded? We have an issue where we're trying to re-apply filtering (via the persistence framework) however we can't apply that until the grid is completely loaded with data (otherwise there are errors, etc). The Loaded event appears to get raised before the data is fully loaded. Any other ideas?
Hello Dustin,
Thank you for contacting Infragistics Developer Support.
My team and I have done an initial investigation into whether or not there exists an event or property flag on the XamGrid control that designates that the grid is “fully” loaded. At the moment, the best single event I can currently recommend is usage of the Loaded event, as this designates that the grid is part of your application’s visual tree. Rather than just using this event, though, I would recommend inserting a Dispatcher.BeginInvoke action running at a DispatcherPriority of ApplicationIdle. This should wait until your application idles, giving the XamGrid time to finish its rendering operations. The code for this would look like the following:
//In the Loaded event…Dispatcher.BeginInvoke(new Action(() => { //your persistence code here.}), DispatcherPriority.ApplicationIdle);
I would expect that this would work as it should delay your persistence code enough that the grid should be “fully” loaded. If this is not the case, please let me know, and I will continue to investigate into other possibilities that you may be able to use.
Please let me know if you have any other questions or concerns on this matter.
Hi Andrew - thanks for the reply. This unfortunately probably won't work for us as we have the ability to refresh the user control that the XamGrid is contained in, and this doesn't raise the Loaded event again. So this might only work the first time the grid is loaded, not when it's refreshed after.