IsContentPreserved for RadOutlookBar?

8 posts, 0 answers
  1. Richard
    Richard avatar
    30 posts
    Member since:
    Oct 2010

    Posted 18 Jul 2011 Link to this post

    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




  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 21 Jul 2011 Link to this post

    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!

  3. DevCraft banner
  4. Marc
    Marc avatar
    88 posts
    Member since:
    Jul 2011

    Posted 14 Oct 2011 Link to this post

    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
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 Oct 2011 Link to this post

    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 >>

  6. Marc
    Marc avatar
    88 posts
    Member since:
    Jul 2011

    Posted 19 Oct 2011 Link to this post

    Of course, that would be great!

    Thank you.
  7. Marc
    Marc avatar
    88 posts
    Member since:
    Jul 2011

    Posted 19 Oct 2011 Link to this post

    It would be great if you could create this feature request ... ;-)


    Thank you.
  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 21 Oct 2011 Link to this post

    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 >>

  9. Thomas Mutzl
    Thomas Mutzl avatar
    39 posts
    Member since:
    Oct 2006

    Posted 14 Mar 2012 Link to this post

    +1
    Please!!!
Back to Top
DevCraft banner