HierarchChildTemplate with TabControl

5 posts, 0 answers
  1. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 27 Mar 2013 Link to this post

    I have a HierarchyChildTemplate which contains a TabControl.  The model driving content for to the HierachyChildTemplate has collections to drive the content in each TabControl.  The issue is when there is a change to a collection driving one of the tabs the tab fires the SelectionChanged event.  One of these tab items holds the the FlowDocumentReader control so the SelectionChanged cannot be bubbled up and caught by the TabControl.  The update to the data is reflected correctly by the way.

    I replaced the Microsoft TabControl with the RadTabControl in hopes that your control will have special handling for this, like the additional support you provide with the IsContentPreserved property.  However, I see no default handling for this and find nothing within the RadTabControl I can use to deal with this.

    How can I keep the tab fro changing to index 0 every time there is a change?

    Thanks

    Paul
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1246 posts

    Posted 28 Mar 2013 Link to this post

    Hi Paul,

    I am not sure that I understand your scenario. Can you please elaborate on the way that your business collections are loaded to the content of the RadTabControl. Also, it will be best if you send me your project or reproduce the issue in a separate project and send it over. This way I will be able to fully understand your scenario and suggest the best approach in your case.

    Thank you for your cooperation in advance.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 28 Mar 2013 Link to this post

    While putting together the sample project I see the root problem stems from calling Reset on the SortDescriptors collection.  In my use case the contents of the grid are changing continually.  If the change is to a column which is being sorted the sort appears to be off because the grid does not reposition the row based upon the new value.  As a result, each update to the grid I call SordDescriptors.Reset.  When this occurs the HierachyChildTemplate which is opened does remain opened but the first tab item is selected.

    To reproduce this expand a row, select a tab item other than the first one and resort by clicking the column header.

    I submitted the requested sample project under ticket 676438.

    Thanks

    Paul
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3299 posts

    Posted 01 Apr 2013 Link to this post

    Hello Paul,

    We've posted a reply in the support thread you started and it would be best to continue the communication there.

    Also, in case anyone else encounters the same issue I will post the suggested solution here as well:

    By design the Hierarchy's content is re-loaded once the collection is Reset (through the SortDescriptors collection in this case). As a workaround we would suggest you to persist the state of the selected TabItem when the TabControl is unloaded (Unloaded event is raised) and then set it back when the Loaded event is raised for it.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 01 Apr 2013 Link to this post

    Thank you for your response.  I will implement your suggestion and verify the outcome.

    Thanks again.

    Paul
Back to Top