This is a migrated thread and some comments may be shown as answers.

Does the PersistenceFramework work with GridSplitter

2 Answers 139 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 18 Aug 2011, 11:28 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Alex Fidanov
Telerik team
answered on 18 Aug 2011, 05:23 PM
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 >>

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 18 Aug 2011, 08:41 PM
Thank you this will do just fine :)
Tags
PersistenceFramework
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Kristjan Einarsson
Top achievements
Rank 1
Share this question
or