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

HierarchChildTemplate with TabControl

4 Answers 92 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 27 Mar 2013, 09:29 PM
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

4 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 28 Mar 2013, 01:25 PM
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.

0
Paul
Top achievements
Rank 1
answered on 28 Mar 2013, 05:31 PM
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
0
Tina Stancheva
Telerik team
answered on 01 Apr 2013, 07:26 AM
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.

0
Paul
Top achievements
Rank 1
answered on 01 Apr 2013, 01:40 PM
Thank you for your response.  I will implement your suggestion and verify the outcome.

Thanks again.

Paul
Tags
GridView
Asked by
Paul
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Paul
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or