What is the last event to get fired after data has been loaded into a grid and all rows have been initialized?
There is no such event; the order is basically 'Set DataSource -> InitializeLayout event -> InitializeRow events'. What is it that you're trying to do? Generally most grid-specific logic should go into the InitializeLayout event. You should be able to put code immediately after you set the DataSource of the grid, since the InitializeLayout and InitializeRow events will fire synchronously, and thus before they get to the code that you place after setting the DataSource.
-Matt
I have a timer that runs at a specified interval and automatically refreshes the grid with new data. During times of heavy load the time it takes the grid to load new data is greater than the timer's interval. That is causing my app to lock up because the timer tick events are piling up in the queue. So what I am going to do is disable the timer at the beginning of the data refresh method. I just wanted to make sure I didn't reenable the timer until the grid was completely done with its stuff. It sounds like I can reenable my timer in the finally block of the refresh method and I should be alright.
Thanks for your help Matt ...
What version are you using? I know that in 7.3 there were several optimizations, one of which involved this kind of scenario, so if don't have this verison (and the latest hotfix), you may see some improvements.
I'm using version v.7.1 b.20071.40. Are there any problems with uninstalling my current version, installing 7.3, running some tests, and then going back to version 7.1 if necessary? We have tons of 7.1 grids in this application and if 7.3 causes some issues in any of them I will want to get back to 7.1 safely. Is there anything I should be aware of along those lines?
You can have both versions installed at the same time with no issues. What you should probably do is make a copy of your application and upgrade it to 7.3 to do your tests. Should you decide that there are any problems, you still have the 7.1 version of your app. Make sure you download the latest hotfixes too; I noticed that you still have the release version of 7.1 as well.
Great. Thanks Matt. I'm currently using the new version right now for some testing. One more question for you concerning memory/garbage collection issues. I notice when I am refreshing data in my app the memory for the app kind of ebbs and flows with a general trend upward. Every once in a while garbage collection will kick in and clear out a decent chunk of memory. That I understand. What I'm a little confused about is if I minimize the application window the memory allocation for the app hits the floor. A ton of memory is cleared out. Even when I restore the window the memory increases, but it is nowhere near the point it was at when I minimized it. Can you explain that, and is there a way to force that kind of memory clean up within the grid programmatically?
Thanks for all your help Matt ...
Thanks for the info Matt ...
I wouldn't think that this is anything that you would have any control over, but rather something that the OS and .NET take care of. I'm completely speculating here, but when you minimize a window, the OS basically says that nothing needs to be painted currently, so any of the various paint-related objects can be cleaned up by garbage collection; it would be interesting to test this theory on Vista, since if you mouse-over a window in the taskbar, even when it's minimized, it will draw to a preview window. You could certainly try to force garbage collection by calling GC.Collect(), but there is no guarantee that this will clean up everything, since I believe it also runs on a separate thread. Naturally once you show a minimized form, the memory usage will go up because the various controls need to draw themselves, and in our case we need to create the UIElements that comprise each control.