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

IsContentPreserved for RadOutlookBar?

7 Answers 128 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Richard
Top achievements
Rank 1
Richard asked on 18 Jul 2011, 07:49 PM
Hi,


The RadTabControl has a nice property IsContentPreserved, which preserves the state of the UI (the item container) when the tab control is bound to a collection. I'm wondering if there's any way to accomplish the same thing using the RadOutlookBar.


We're using the following markup to bind a RadOutlookBar to a collection of viewmodels called Sections. Each Section viewmodel has a collection of RootNode viewmodels, which should be displayed in the tree when the user selects that section.

<telerik:RadOutlookBar ItemsSource="{Binding Sections}" SelectedItem="{Binding SelectedSection, Mode=TwoWay}">
    <telerik:RadOutlookBar.ContentTemplate>
        <DataTemplate>
            <telerik:RadTreeView ItemsSource="{Binding RootNodes}"
                ItemTemplateSelector="{StaticResource NavigationTemplateSelector}"
                SelectedItem="{Binding SelectedNode, Mode=TwoWay}" />
        </DataTemplate>
    </telerik:RadOutlookBar.ContentTemplate>               
</telerik:RadOutlookBar>

(This is a bit simplified from our actual markup, but it's the same basic idea.)


The problem we're having is that the state of the tree isn't preserved if the user switches away to a different section and back again.

For example, if the user is in the Portfolio Manager section, they see a tree with nodes relevant to portfolio management. A user might drill down in the tree and select a particular node. Then they might switch away to the Risk Manager section, by clicking its button in the RadOutlookBar. The Risk Manager section has its own tree with different nodes. The user drills down and selects a particular node in that tree. Then they switch back to the Portfolio Manager section by clicking its outlook bar button.

What I'd like is for the Portfolio Manager tree to now appear exactly as it did when the user left it. Instead, the tree appears collapsed.

I can work around this by binding the IsExpanded property on the tree nodes, as documented here. But if I do this, it still doesn't really look right - among other things, the scroll position isn't preserved if the user had selected a node far down in the tree.

Is there a better way to do this?


Thanks for your help,
Richard




7 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 21 Jul 2011, 01:37 PM
Hi Richard,

We suggest you to work with your ViewModels. You can bind the IsExpanded, IsSelected properties of the RadTreeViewItem via ContainerBindings. On the other hand, the scroll position of the RadTreeView`s ScrollViewer can be accessed like so:

double offset = this.treeView.ScrollViewer.VerticalOffset;
 Please let us know if this fits in your scenario.Kind regards,
Petar Mladenov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Marc
Top achievements
Rank 1
answered on 14 Oct 2011, 06:19 PM
Is there any chance that the IsContentPreserved property of RadOutlookbar will work as for RadTabControl in the next release? I'm currently facing the exact same problem as mentioned above (tree in each section loosing expansion state on selectionchange). The solution with model binding and scroll tracking does not look inviting to me. Doing all this stuff unnecessarily complicates my code when all I actually need is to set an existing (but not working) property.

I tried this in the current build. Unfortunately it doesn't work? Are there any plans to resolve this issue?


Thank you,
Stephan
0
Petar Mladenov
Telerik team
answered on 19 Oct 2011, 03:31 PM
Hello Stephan,

 The RadOutlookBar inherits from RadTabControl and that's why the IsContentPreserved is available. Actually it should not be visible and should not be used. We could create a feature request describing that it will be good to have such functionality implemented in RadOutlookBar. Is this suitable for you?

Regards,
Petar Mladenov
the Telerik team

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

0
Marc
Top achievements
Rank 1
answered on 19 Oct 2011, 03:33 PM
Of course, that would be great!

Thank you.
0
Marc
Top achievements
Rank 1
answered on 19 Oct 2011, 04:46 PM
It would be great if you could create this feature request ... ;-)


Thank you.
0
Petar Mladenov
Telerik team
answered on 21 Oct 2011, 09:46 AM
Hi Stephan,

 Here is the link to the newly created feature request in our PITS.

Kind regards,
Petar Mladenov
the Telerik team

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

0
Thomas
Top achievements
Rank 1
answered on 14 Mar 2012, 02:50 PM
+1
Please!!!
Tags
OutlookBar
Asked by
Richard
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Marc
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Share this question
or