I'm defining a datagrid's RowDetailsTemplate in the following way:
RowDetailsTemplate="{StaticResource defaultTemplate}"
where
<UserControl.Resources>
<DataTemplate x:Key="defaultTemplate">
<StackPanel>
<TextBlock Text="default" x:Name="_txt" />
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="otherTemplate">
<StackPanel>
<TextBlock Text="other" x:Name="_txt" />
</StackPanel>
</DataTemplate>
</UserControl.Resources>
Is there a way to programatically define which of the two above DataTemplates a given row is to use (perhaps in the LoadingRowDetails() event)?