Hello,
I am creating a parent-child grid. The child columns need to be excatly under the columns of the parent
as they visually share the same columns.
To support this feature, I need to have a column's width on the child resize as the user resises a parent column.
I tried using a bind on the child template as shown below
Width="{Binding ElementName=RadGridView1, Path=ActualWidth}"
however it does not seem to work.
Then I tried to manually set the width of the cells on that column (including the headerCell)
however the splitter line between the column does not resize and setting it manually does not seem to do the trick.
Any ideas ?
<telerik:RadGridView Height="286" Name="RadGridView1" Width="720"
AutoGenerateColumns="false"
IsFilteringAllowed="true"
FlowDirection="RightToLeft"
ShowGroupPanel="False"
Loaded="RadGridView1_Loaded">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn UniqueName="ID"
DataMemberBinding="{Binding Path=ID}"
Header="ID"
Width="Auto" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<StackPanel DataContext="{x:Null}">
<telerik:RadGridView x:Name="gridDetails"
CanUserReorderColumns="False"
CanUserFreezeColumns="False"
ShowGroupPanel="False"
ColumnsWidthMode="Auto"
AutoGenerateColumns="False"
ItemsSource="{Binding}"
Loaded="OnChildGridLoaded"
ShowColumnHeaders="True">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn UniqueName="ID"
DataMemberBinding="{Binding Path=ID}"
HeaderText="ID"
Width="{Binding ElementName=RadGridView1, Path=ActualWidth}"
/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</StackPanel>
</DataTemplate>
</telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView>
Thanks,
Erez