(Background) We started in 2003 with the UltraWebGrid and good, ol'fashioned demand loading. When a user expanded a row, we retrieved the data from web services. Later moving to WinForms, no problem. By now, of course, we have a robust server DAL and BL that we must continue with.
With SL XamGrid I'm trying to use the same paradigm with only moderate success. We use a classic business object model with an ObservableCollection of objects, each of which includes detail properties, and an ObservableCollection of items that provide the hierarchy.
Expanding grid rows works pretty well. Before expansion, the object's hierarch Collection contains only one (null) object to get the grid to display the expansion arrow. After cancelling the RowExpansionChanging event in the handler, I dispatch a series of events that clear the null entry, and populate the data object's hierarchy list from a web service. The UI is update fine (I assume) by handling the CollectionChanged event for both the delete and adds.
If we left everything in tack, all is well. But, when we expand a row we need prune its siblings (which works), but now the objects heirarchy list has also changed.
When collapsing using either the RowExpansionChanging, or RowExpansionChanged event, the methods I dispatch to Clear, and then reload the hierarchial data don't update the UI as I (really, really) wished. Even trying to synch the grid rows with my data model doesn't work, because of course I can only access visible grid rows.
I apologize for this being so long a tedious, but I'm nearing the end on this quest and don't want to give up. It doesn't appear the Data Virtualization applies in the case.
Any help will be greatly appreciated.
Hi,
Maybe you could use our VirtualCollection component to achieve your load on demand scenario. See this post for a sample.
Let us know how that works for you or if there are any questions.
HTH,