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

Validation and tab control

2 Answers 208 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 17 Feb 2011, 05:27 PM
I have a validators on my cotrols, when I am switching tabs validation errors disapear for all controls.

 <TextBox Text="{Binding SelectedJob.Well.Formation,ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" />


Can you suggest a fix for this problem?

2 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 22 Feb 2011, 04:56 PM
Hello Thomas,

When you give the TabControl a ContentTemplate and bind it to some collection of items, then switching between tabs makes the TabControl unload the content of the last active item and load the content of the newly selected item. The reason is that the RadTabControl has only one ContentPresenter which holds the currently selected RadTabItem for performance optimization. And since the load/unload operations involve add/remove actions in the visual tree, the content does not keep its state.

However, we have logged this issue as a feature request in our PITS where you will be able to track its progress and vote for it thus increasing its priority.

As a workaround, you can keep the state of the RadTabItem's content in a ViewModel. If you can elaborate on your scenario and the ViewModels we will try to provide you with a possible implementation.

Kind regards,
Tina Stancheva
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Jawahar
Top achievements
Rank 1
answered on 06 Jun 2014, 08:23 PM
http://karlshifflett.wordpress.com/2008/02/19/wpf-validation-errors-disappear-inside-tabcontrol-when-switching-tabitems/

Refer this

Tags
TabControl
Asked by
Thomas
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Jawahar
Top achievements
Rank 1
Share this question
or