In one of our migration project we have a Silverlight project. Most of the controls used in that project are custom controls. In one of its functionality, a grid containing the records of child and parent gets loaded. Initially only the parent details gets loaded with one expand symbol next to it. On clicking expand button child details gets loaded.
I need to know what exactly is happening behind the scene when we are clicking on expand button. When child records are more it takes time to load. I tried to debug but no postback call is happening.
Let me know in case you need more detail.
Please guide.
So, assuming you are dumping silverlight?
Then to nest a grid, you can say drop in a listview, and then inside of the listview, we drop in a grid view. You can try and nest two gridviews, but I find they don't work well, but a listview for the main grid, and then for child grid, then a grid view is just fine.
So, markup will look say like this (listview, then nested gridview).
Now to be fair, above is about as much mark-up we would include in a post on SO (any more, and no one will read or bother with this post.
Ok, so the code to load up the listview (the main part). Would be this:
Output:
Ok, so now we need the code for the "+" button. When clicked, it will expand, and show the child gridview.
That code is like this:
Note how the child rows are NOT loaded until you click. Clicking on a + button this results in this:
And the state of the expand/close does remain intact.
And thus now if we expand again, then the data does not have to be re-loaded.