This question is locked. New answers and comments are not allowed.
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.
(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
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