I need to load detail data on-demand when I expand a row. I patterned my application after the sample provided in this thread: http://www.telerik.com/community/forums/silverlight/gridview/load-on-demand-gridview.aspx. I establish a Loaded handler in the HierarchyChildTemplate.
and load the detail rows in that handler:
So far, so good. The problem is that the Loaded event only fires the first time the row is expanded. What do you do if your detail data is also dynamic, and you want to reload it each time the row is expanded, or, say, if you just want to refresh it in response to user input?
I found the LoadingRowDetails event in the doc, which says it will fire "the very first time the row details are about to be shown. Once this event has been fired, it will never fire again for that row. However, if the row is recycled and then realized, it starts its "life" again, this event will be fired again the first time the details are about to be shown."
I think this is related, although I'm not using the LoadingRowDetails event, and never got it to fire when I tried it. I have no idea what "if the row is recycled and then realized" means. How do I reset the details so the event fires when the row is expanded the 2nd through nth time?
Another aspect of the problem is this: in general, how can you find a given row's detail grid? I can't even find a Rows collection.
Thank you,
KO
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
telerik:RadGridView
x:Name
=
"DetailGrid"
DataContext
=
"x:Null"
ShowGroupPanel
=
"False"
Loaded
=
"DetailGrid_Loaded"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
.
.
.
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
DataTemplate
>
</
telerik:RadGridView.HierarchyChildTemplate
>
and load the detail rows in that handler:
private void DetailGrid_Loaded(object sender, RoutedEventArgs e)
{
DetailGrid = (RadGridView)sender;
SelectedEvent = (EventMaster)DetailGrid.ParentRow.DataContext;
// Go make round trip to get detail data and set in DetailGrid.ItemsSource
// when round trip returns.
}
So far, so good. The problem is that the Loaded event only fires the first time the row is expanded. What do you do if your detail data is also dynamic, and you want to reload it each time the row is expanded, or, say, if you just want to refresh it in response to user input?
I found the LoadingRowDetails event in the doc, which says it will fire "the very first time the row details are about to be shown. Once this event has been fired, it will never fire again for that row. However, if the row is recycled and then realized, it starts its "life" again, this event will be fired again the first time the details are about to be shown."
I think this is related, although I'm not using the LoadingRowDetails event, and never got it to fire when I tried it. I have no idea what "if the row is recycled and then realized" means. How do I reset the details so the event fires when the row is expanded the 2nd through nth time?
Another aspect of the problem is this: in general, how can you find a given row's detail grid? I can't even find a Rows collection.
Thank you,
KO