This question is locked. New answers and comments are not allowed.
Hello everyone,
In my application I have 2 RadExpanders. Each RadExpander contains a RadGridView. One RadExpander has IsExpanded set to TRUE other is set to FALSE. Also I am saving RadGridViews settings, using your example. The problem is that for the RadGridView that is placed in RadExpander with IsExpanded set to FALSE, DisplayIndex for all grid's columnsis set to -1, not to the corresponding oreder of the column.
Below is the code I use:
It seems that settings are saved correctly just for visible in UI grid.
Thank you
Best regards
Alexandru
In my application I have 2 RadExpanders. Each RadExpander contains a RadGridView. One RadExpander has IsExpanded set to TRUE other is set to FALSE. Also I am saving RadGridViews settings, using your example. The problem is that for the RadGridView that is placed in RadExpander with IsExpanded set to FALSE, DisplayIndex for all grid's columnsis set to -1, not to the corresponding oreder of the column.
Below is the code I use:
<UserControl x:Class="GridSettings.MainPage" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:local="clr-namespace:GridSettings" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <StackPanel> <telerik:RadExpander Margin="2" IsExpanded="False" Header="Not Visible Grid"> <telerik:RadExpander.Content> <telerik:RadGridView local:RadGridViewSettings.SaveSettings="True" Name="hiddenGrid"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Name" /> <telerik:GridViewDataColumn Header="Surname" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </telerik:RadExpander.Content> </telerik:RadExpander> <TextBlock Text="Column index"></TextBlock> <ListBox Margin="2" ItemsSource="{Binding ElementName=hiddenGrid, Path=Columns}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Header}" Margin="2" /> <TextBlock Text="Display Index:" Margin="2" /> <TextBlock Text="{Binding DisplayIndex}" Margin="2" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> <StackPanel Grid.Row="1"> <telerik:RadExpander Margin="2" IsExpanded="True" Header="Visible Grid"> <telerik:RadExpander.Content> <telerik:RadGridView local:RadGridViewSettings.SaveSettings="True" Name="visibleGrid"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Name" /> <telerik:GridViewDataColumn Header="Surname" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </telerik:RadExpander.Content> </telerik:RadExpander> <TextBlock Text="Column index"></TextBlock> <ListBox Margin="2" ItemsSource="{Binding ElementName=visibleGrid, Path=Columns}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Header}" Margin="2" /> <TextBlock Text="Display Index:" Margin="2" /> <TextBlock Text="{Binding DisplayIndex}" Margin="2" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </Grid></UserControl>Thank you
Best regards
Alexandru