Hi guys,
Please excuse us for the inconvenience caused. I have investigated the issue. There is definitely a bug in the RadGridView preventing the child grid to contain customized rather than autogenerated columns.
The child grids automatically get a full set of autogenerated columns disregarding any XAML declared columns.
We have already started fixing this. Meanwhile I have prepared a sample with a workaround approach.
Please find it attached.
What is important in the example :
The following code :
<StackPanel DataContext="{x:Null}">
<telerik:RadGridView ...
...
prevents the child RadGridView to get the automatic columns.
and the following lines bypass the "auto" logic and feeds the child grid with data:
In code behind:
private void RadGridView_Loaded(object sender, RoutedEventArgs e)
{
((RadGridView) sender).DataContext = ((RadGridView) sender).ParentRow.DataContext;
}
...
And in xaml :
<
telerik:RadGridView Width="200" Loaded="RadGridView_Loaded" ItemsSource="{Binding Staff}" ...
This way the child grid now respects the two declarative columns in the HierarchyChildTemplate.
If you need any help on customizing the example for your needs just let me know. Meanwhile we are doing our best to fix the problem.
Kind regards,
Pavel Pavlov
the Telerik team