Does the PersistenceFramework work with GridSplitter

3 posts, 1 answers
  1. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 18 Aug 2011 Link to this post

    Hi If I have this scenario:

    <telerik:RadToggleButton Content="Switch View" Width="90" Grid.Row="0" HorizontalAlignment="Left" IsChecked="{Binding Path=AlternitiveViewActive }" Checked="ToggleButton_Checked"  Unchecked="RadToggleButton_Unchecked" />
                 
                <Grid Grid.Row="1" Name="gridUnTabbed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <telerik:RadTabControl Grid.Column="0">
                        <telerik:RadTabItem Header="Exception" >
                            <ScrollViewer>
                                <TextBox Name="txtException2" TextWrapping="WrapWithOverflow" />
                            </ScrollViewer>
                        </telerik:RadTabItem>
                    </telerik:RadTabControl>
     
                    <GridSplitter Grid.Column="1" Name="tabSplitter" Width="4" ResizeBehavior="PreviousAndNext" Background="Gray" HorizontalAlignment="Stretch" />
     
                    <telerik:RadTabControl Grid.Column="2">
                        <telerik:RadTabItem Header="StackTrace">
                            <ScrollViewer>
                                <TextBox Name="txtStackTrace2" TextWrapping="WrapWithOverflow" />
                            </ScrollViewer>
                        </telerik:RadTabItem>
                    </telerik:RadTabControl>
                </Grid>

    Can I let the PersistenceFramework remember how the splitter was located ?  And can I use it to remember window size, ToggleButton checked / unchecked status and so on ?

    I did some experiments with the telerik:PersistenceManager.StorageIs then saved the status via IsolatedStorageProvider isoProvider but the splitter location remained the same... Any ideas ?

    Best regards
    kristján
  2. Answer
    Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 18 Aug 2011 Link to this post

    Hi Kristjan Einarsson,

    Thank you for bringing this to our attention. The issue here is not with the GridSplitter control but with the Grid panel itself. What the GridSplitter does is to change the Width of the ColumnDefinitions, which it resizes. So, if you want to save the position of the GridSplitter, you need to save the column definitions. 

    However, the PersistenceFramework does not save the Column(Row)Defitinions property. A collection must contain UIElement objects in order to be serialized. However, the ColumnDefinition is subclass of the ContentElement and not of the UIElement ancestor chain. This is something we are considering to change in the upcoming internal builds.

    I have attached a small project (using latest internal builds) demonstrating how to save the columns' positions as an alternative, until we resolve the restriction mentioned above.

    All the best,
    Alex Fidanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 18 Aug 2011 Link to this post

    Thank you this will do just fine :)
Back to Top