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

Current view changes when activating tab?

5 Answers 71 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Charles Bates
Top achievements
Rank 1
Charles Bates asked on 18 Jun 2010, 04:47 PM
Hello,
We have a RadTabControl inside a RadPane.
Each RadTabItem contains a Grid, with a ScrollViewer containing  a Canvas.
The user can move the canvas using the scroll bars or using the mouse to grab and drag the canvas.

When a tab item is made current by clicking on it, the postion of the canvas is changed; typically, but not always, it is changed to the position of the canvas when the tabitem was first created and the canvas added to it.

I cannot find any code that we produced that accounts for this (although I am still looking...)  Whle we have a SelectionChanged handler for the TabControl, it does nothing to reposition the canvas.
Is there something we can do in the TabControl / TabItem that would prevent this repositioning?
I'll try to reproduce in a simple sample app.
Thanks,
C. Bates

5 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 23 Jun 2010, 02:05 PM
Hi Charles Bates,

This behavior is expected since switching between tabs makes the TabControl unload the content of the last active item and load the content of the newly selected item, when the control is data bound to some collection of items. This load/unload operations involve add/remove actions in the visual tree, thus the content does not keep its state.

However, there is a corresponding item in our PITS, which you can vote for thus increasing its priority.

Kind regards,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Peter
Top achievements
Rank 1
answered on 15 Jul 2010, 02:29 PM
I too have voted this up (and is quite important)
My situation:
RadTabControl bound to a collection
Each item in the collection represents an item containing a list of data which is presented to the user in a RadGridView
the problem is that I want the user to be able to group/resize columns/hide+add columns, and this should still be available when the user switches back.
The problems I am facing with the current implementation (unloading + loading data on demand):
- apparent flickering of the screen when switching tabs (+delay)
- losing the things the user changed (scroll position, grouping, column reordering, ...)

I found a solution with using an ItemsControl and setting the visibility based on the selected tab but then I have layout issues with the RadGridView (does not take full height automatically + if too many rows, does not display a scrollbar but renders completely, even outside of the visible window)
0
Peter
Top achievements
Rank 1
answered on 15 Jul 2010, 02:42 PM
if anyone has any suggestions for a temporary fix, feel free...
0
Charles Bates
Top achievements
Rank 1
answered on 16 Apr 2011, 03:29 PM
Hello --
I saw in PITS that this is marked "Resolved" in 2010 Q3 SP+.  I have 2010.3.1326.1040 installed, and can't find the IsContentPreserved property.
What is the minimum version that supports this?
Thanks.

0
Tina Stancheva
Telerik team
answered on 19 Apr 2011, 04:23 PM
Hello Charles Bates,

This property was introduced with the Q1 2011 official release. You can examine the release notes here.

All the best,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabControl
Asked by
Charles Bates
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Peter
Top achievements
Rank 1
Charles Bates
Top achievements
Rank 1
Share this question
or