SanthoshKumar SanthoshKumar - 3 months ago 30
C# Question

Expand All on default RadGridView WPF

I'm using

Telerik:RadGridView
in my
WPF
application. This is a nested grid which has child grid. Now on default load i should expand all the rows. I tried few things but not working.

//Code:

<telerik:RadGridView x:Name="grdExpan" AutoGenerateColumns="False" CanUserInsertRows="False" IsSynchronizedWithCurrentItem="True" AutoExpandGroups="True" GridLinesVisibility="Horizontal" telerik:StyleManager.Theme="Windows8" Grid.Row="0" VerticalAlignment="Top" ClipboardPasteMode="None" ShowGroupPanel="False" ItemsSource="{Binding SList, Mode=TwoWay, Source={StaticResource CopyViewModel}, UpdateSourceTrigger=PropertyChanged}" RowHeight="30" RowIndicatorVisibility="Collapsed" CanUserReorderColumns="False" AlternationCount="2" IsFilteringAllowed="False" >


Tried
AutoExpandGroups="True"
and in code behind tried in constructor

public CopyWindow()
{
InitializeComponent();
grdExpan.ExpandAllHierarchyItems();
}


Kindly help.

Answer

You can try calling the ExpandAllHierarchyItems method in the Loaded event of your window, or alternatively check this forum thread out: link

Comments