I have a GridView (WPF 4.5, Q2 2013) that has another GridView in its RowDetailsTemplate. When I set the width to "*" on any columns of the second RadGridView, the DetailsPresenter gets extremely long (about 10000 px), even though I only have two columns that should fit on the screen.
I found a strange solution: in a new style for RadGridView, if I wrap the GridViewVirtualizingPanel in a Grid and apply it to "SecondGridView" in the RowDetailsTemplate, the columns size normally. I am hesitant to do this because I don't understand why it works; is there a better way?
Here is what I am working with, where the columns get really long:
I found a strange solution: in a new style for RadGridView, if I wrap the GridViewVirtualizingPanel in a Grid and apply it to "SecondGridView" in the RowDetailsTemplate, the columns size normally. I am hesitant to do this because I don't understand why it works; is there a better way?
Here is what I am working with, where the columns get really long:
<DataTemplate x:Key="MyRowDetailsTemplate" > <Border > <controls3:RadGridView x:Name="SecondGridView" ItemsSource="{Binding MoreItems}"> <controls3:RadGridView.Columns> <controls3:GridViewDataColumn Width="*" MinWidth="200" Header="Name" /> <controls3:GridViewDataColumn Width="75" MinWidth="75" Header="Status" /> </controls3:RadGridView.Columns> </controls3:RadGridView> </Border> </DataTemplate><controls:RadGridView Name="TemplateRoot" ItemsSource="{Binding MyItems}" RowDetailsTemplate="{DynamicResource MyRowDetailsTemplate}"> <controls:RadGridView.Columns> <controls:GridViewDataColumn Width="*" MinWidth="200" Header="Name"/> <controls:GridViewDataColumn Width="75" MinWidth="75" Header="Status"/> </controls:RadGridView.Columns></controls:RadGridView>