This question is locked. New answers and comments are not allowed.
Hi,
I have a RadGridView that is bound to an ObservableCollection of objects that have a property that is an ObservableCollection. To represent this, my gridview has a child gridview that is bound to this property. When I have the parent gridview's AutoGenerateColumns property set to false, the child grid is blank when expanded. It takes up the appropriate space as it would if visible but is just a blank white rectangle (see attachment - GridViewWithBlankChild.gif). If I set the parent gridview's AutoGenerateColumns property to true it all works as I would expect (see attachment - GridViewAutoGenerateColumnsIsTrue.gif). I need to define both the parent and child gridview columns so this is not an option. Please help.
Below is my xaml:
I have a RadGridView that is bound to an ObservableCollection of objects that have a property that is an ObservableCollection. To represent this, my gridview has a child gridview that is bound to this property. When I have the parent gridview's AutoGenerateColumns property set to false, the child grid is blank when expanded. It takes up the appropriate space as it would if visible but is just a blank white rectangle (see attachment - GridViewWithBlankChild.gif). If I set the parent gridview's AutoGenerateColumns property to true it all works as I would expect (see attachment - GridViewAutoGenerateColumnsIsTrue.gif). I need to define both the parent and child gridview columns so this is not an option. Please help.
Below is my xaml:
<telerik:RadGridView x:Name="grdClientExecForecasts" TabNavigation="Cycle" DataLoadMode="Asynchronous" AutoGenerateColumns="True" CanUserReorderColumns="False" CanUserResizeColumns="False" IsEnabled="True" IsReadOnly="False" MaxWidth="1825" MaxHeight="840" MinHeight="0" VerticalAlignment="Stretch" HorizontalAlignment="Left" SelectionMode="Single" RowDetailsVisibilityMode="Collapsed" EditTriggers="CellClick" SelectionUnit="Cell" IsFilteringAllowed="False" ShowGroupPanel="False" ShowColumnFooters="False" ShowGroupFooters="False" ShowInsertRow="False" RowIndicatorVisibility="Collapsed" ClipboardCopyMode="All" ClipboardPasteMode="None" KeyDown="grdClientExecForecasts_KeyDown" BeginningEdit="grdClientExecForecasts_BeginningEdit" CurrentCellChanged="grdClientExecForecasts_CurrentCellChanged" > <telerik:RadGridView.Columns> <this:ImageColumn Source="../images/edit.png" MouseLeftButtonDown="Edit_MouseLeftButtonDown" Tooltip="Click to edit client executive forecast." ImageHeight="15" ImageWidth="15" /> <telerik:GridViewDataColumn Header="Id" Width="50" DataMemberBinding="{Binding ClientExecForecastsId}" IsReadOnly="True"/> <telerik:GridViewDataColumn Header="Client Name" Width="200" DataMemberBinding="{Binding ClientName}" IsReadOnly="True"/> <telerik:GridViewDataColumn Header="Product" Width="200" DataMemberBinding="{Binding ProductName}" IsReadOnly="True"/> <telerik:GridViewDataColumn Header="Client Type" Width="100" MaxWidth="100" MinWidth="75" DataMemberBinding="{Binding ClientTypeId, Mode=TwoWay, Converter={StaticResource clientTypeConverter}}" IsReadOnly="True"/> <telerik:GridViewDataColumn Header="Agency" Width="200" MaxWidth="200" MinWidth="76" DataMemberBinding="{Binding AgencyName}" IsReadOnly="True"/> <this:ImageColumn Source="../images/delete.png" MouseLeftButtonDown="Delete_MouseLeftButtonDown" Tooltip="Click to delete client executive forecast." ImageHeight="15" ImageWidth="15" /> </telerik:RadGridView.Columns> <telerik:RadGridView.HierarchyChildTemplate> <DataTemplate> <telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding ClientExecForecastAmounts}" DataLoadMode="Asynchronous" > <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Station" DataMemberBinding="{Binding StationId}" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </DataTemplate> </telerik:RadGridView.HierarchyChildTemplate> <telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition> <telerik:GridViewTableDefinition.Relation> <telerik:PropertyRelation ParentPropertyName="ClientExecForecastAmounts"/> </telerik:GridViewTableDefinition.Relation> </telerik:GridViewTableDefinition> </telerik:RadGridView.ChildTableDefinitions> </telerik:RadGridView>