Our use case is to have a grid which can be expanded to show more granular details including child data, similar to your samples. One of the catches is that not all the data is available in the ItemsSource collection of objects. To avoid what will appear as a memory leak over time, we chose to load / unload the child data as needed. We have success using the RowIsExpandedChanged event to manage the data. We also use the HierarchyChildTemplate and specify the DataTemplate as a collective group of controls and UserControls.
One of these UserControls is another GridView to present a collection of child details of the parent record. This user control will subscribe to events and update its grid with additions and edits. To wire up these events we use an identifier passed to the control via a DependancyProperty. We have found that once a row has been expanded and the UserControl initialized for those events it will remain in effect even when the row is collapsed. To confirm this we wired up the CoerceValueCallback on the DependancyProperty and it is not getting fired when we expand the row after the first time. We understand that due to the virtualization rows are destroyed when out of view. So, in turn, just the event of the user scrolling around will perform a sort of "clean up." As good practice of not leaving resources in use when no longer visible, is there some property we should be setting to destroy the HierarchyChildTemplate when the row is collapsed?
Here are some segments of code we are using.
<Telerik:RadGridView Grid.Row="1" x:Name="radGridViewMain" ItemsSource="{Binding Incidents}"
IsReadOnly="True" AutoGenerateColumns="False" CanUserFreezeColumns="False"
RowIsExpandedChanged="radGridViewMain_RowIsExpandedChanged"
ShowGroupPanel="True" RowIndicatorVisibility="Collapsed"
TelerikGridViewHeaderMenu:GridViewHeaderMenu.IsEnabled="True"
CustomFilter:CustomFilterBehavior.TextBox="{Binding ElementName=textBoxFilter}">
<Telerik:RadGridView.ChildTableDefinitions>
<Telerik:GridViewTableDefinition>
<Telerik:GridViewTableDefinition.Relation>
<TelerikWindowsData:PropertyRelation ParentPropertyName="PrimaryKey"/>
</Telerik:GridViewTableDefinition.Relation>
</Telerik:GridViewTableDefinition>
</Telerik:RadGridView.ChildTableDefinitions>
<Telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<Controls:ChildItems PrimaryKey="{Binding PrimaryKey}" />