This question is locked. New answers and comments are not allowed.
Hi
Ive looked at the examples and am unable to get the ExpandAllHierarchyItems working.
Xaml is
Code behind is
Regards,
Joe
Ive looked at the examples and am unable to get the ExpandAllHierarchyItems working.
Xaml is
<telerik:RadGridView HorizontalAlignment="Left" VerticalAlignment="Top" x:Name="mainListGrid" ItemsSource="{Binding VillagePrices, Mode=TwoWay}" AutoGenerateColumns="False" Width="1140" Height="520" AutoExpandGroups="True" AlternationCount="2" AlternateRowBackground="#FFF5F5F5" FontSize="10" DataLoadMode="Asynchronous" EnableColumnVirtualization="True" EnableRowVirtualization="True" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" IsFilteringAllowed="False" CanUserFreezeColumns="False" ShowColumnFooters="False" CanUserReorderColumns="True" IsSynchronizedWithCurrentItem="False" DataLoading="RadGridView1_DataLoading" > <telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition /> </telerik:RadGridView.ChildTableDefinitions> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProductType}" Header="" Width="170" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding UnitCount}" Header="Count" Width="40" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding CurrentPrice}" Header="Current Price" DataFormatString="{}{0:c0}" Width="120" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding MarketPrice}" Header="Market Price" DataFormatString="{}{0:c0}" Width="80" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding MarketPercentageChanged}" Header="%" DataFormatString="{}{0:p2}" Width="50" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedPrice}" Header="Proposed Price" DataFormatString="{}{0:c0}" Width="100" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedPriceVariance}" Header="Variance" DataFormatString="{}{0:c0}" Width="100" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedPercentageChanged}" Header="% Change Manual" DataFormatString="{}{0:p2}" Width="100" IsVisible="True" IsReadOnly="False" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedMinimum}" Header="Proposed Min" DataFormatString="{}{0:c0}" Width="90" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedAverage}" Header="Proposed Average" DataFormatString="{}{0:c0}" Width="110" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedMaximum}" Header="Proposed Max" DataFormatString="{}{0:c0}" Width="110" IsVisible="True" IsReadOnly="True" IsSortable="False" /> </telerik:RadGridView.Columns> <telerik:RadGridView.HierarchyChildTemplate> <DataTemplate x:Name="childDataTemplate" > <telerik:RadGridView x:Name="childGrid" BorderThickness="0" ItemsSource="{Binding VillagePriceList}" CanUserFreezeColumns="False" AutoGenerateColumns="False" ShowGroupPanel="False" ShowColumnHeaders="False" RowIndicatorVisibility="Collapsed" IsFilteringAllowed="False" Padding="68,0,0,0" EnableColumnVirtualization="False" IsSynchronizedWithCurrentItem="False" EnableRowVirtualization="False" CanUserSelect="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProductType}" Header="" Width="120" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding UnitCount}" Header="Count" Width="40" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding CurrentPrice}" Header="Current Price" DataFormatString="{}{0:c0}" Width="120" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding MarketPrice}" Header="Market Price" DataFormatString="{}{0:c0}" Width="80" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding MarketPercentageChanged}" Header="% M" DataFormatString="{}{0:p2}" Width="60" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedPrice}" Header="Proposed Price" DataFormatString="{}{0:c0}" Width="100" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedPriceVariance}" Header="Variance" DataFormatString="{}{0:c0}" Width="100" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedPercentageChanged}" Header="% Change Manual" DataFormatString="{}{0:p2}" Width="100" IsVisible="True" IsReadOnly="False" IsSortable="False" Background="Orange" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedMinimum}" Header="Proposed Min" DataFormatString="{}{0:c0}" Width="90" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedAverage}" Header="Proposed Average" DataFormatString="{}{0:c0}" Width="110" IsVisible="True" IsReadOnly="True" IsSortable="False" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ProposedMaximum}" Header="Proposed Max" DataFormatString="{}{0:c0}" Width="110" IsVisible="True" IsReadOnly="True" IsSortable="False" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </DataTemplate> </telerik:RadGridView.HierarchyChildTemplate></telerik:RadGridView>Code behind is
private void RadGridView1_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e){ var dataControl = (GridViewDataControl)sender; if (dataControl.ParentRow != null) { dataControl.Loaded -= dataControl_Loaded; dataControl.Loaded += dataControl_Loaded; }}void dataControl_Loaded(object sender, RoutedEventArgs e){ ((GridViewDataControl)sender).ExpandAllHierarchyItems(); }Regards,
Joe