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

Radtabcontrol changing child field datacontext fields

7 Answers 115 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Daniel Pamich
Top achievements
Rank 1
Daniel Pamich asked on 30 Mar 2010, 04:10 AM
Hi,

We have an application using dock groups and the radpane control.

Whenever we change the tab in the dockgroup all the datacontexts for the controls in the radpane are being changed to a datacontext of one of the other tabs, so all the data is corrupted.

None of our code is changing the datacontext but the RadTabcontrol appears to be doing this. Only the datacontext for the controls is getting changed but not the radpanes datacontext!!!!

Below is the call stack? Any ideas why this is happening?

  PresentationFramework.dll!System.Windows.FrameworkElement.DataContext.set(object value) + 0x24 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedElementDataContext() + 0xc5 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedContainer(bool shouldFocus, Telerik.Windows.Controls.RadTabItem selectedItemContainer) + 0x5a bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedContent(int newIndex) + 0x13b bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.OnSelectedIndexChanged(int oldIndex, int newIndex) + 0x25a bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.OnSelectedIndexChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e) + 0x98 bytes
  WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x4c bytes
  PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x50 bytes
  WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x3c bytes
  WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) + 0x723 bytes
  WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal) + 0x2eb bytes
  WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value) + 0x35 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.SelectedIndex.set(int value) + 0x4d bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.NotifyChildIsSelectedChanged(Telerik.Windows.Controls.RadTabItem child) + 0x7c bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(bool oldValue, bool newValue) + 0x46 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e) + 0x9b bytes



7 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 31 Mar 2010, 08:48 AM
Hello Daniel,

I am not sure that I fully understand what the issue here is. Could you please elaborate a little bit more on the topic. Also, could you please attach a sample project reproducing the issue. This way we will be better able to tackle the issue.

Sincerely yours,
Kiril Stanoev
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
Daniel Pamich
Top achievements
Rank 1
answered on 12 Apr 2010, 06:46 AM
Hi,

Thanks for the quick response. 

I'll try and describe the problem a bit more.

Whats happening is that when a docked item(RadDocumentPlane) is selected, somehow the data contexts for all the child controls for the docked item are been changed. Very confusing.

From the stack track(see below) when the Selected item for a RadTabControl is changed, it then does an internal call to UpdatedSelectedContent and then UpdateSelectedElementDataControl! This is what is changing my datacontexts.

Why does this get called(UpdateSelectedElementDataControl)? and how do I stop it?

RadTabControl.OnSelectedIndexChanged
RadTabControl.UpdateSelectedContent
RadTabControl.UpdateSelectedElementDataContext() 
FrameworkElement.DataContext.set

0
Valentin.Stoychev
Telerik team
answered on 15 Apr 2010, 09:50 AM
Hello Daniel Pamich,

Thank you for this report. The reason why this is done is pretty simple. When you set the DataContext to a RadTabControl the DataContext will not propaget to the selected content and this is causing even more confusion to the users. We decided that we will implement a property that you will be able to control this behavior. The property will be available with the ServicePack that will be released shortly.

Regards,
Valentin.Stoychev
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
Steve Evans
Top achievements
Rank 1
answered on 16 Jun 2010, 02:23 PM
I am noticing the same issue and would like to know if:

a ) the mentioned service pack has been released
b ) if so the intended usage is in this scenario please


Many thanks.

Steve
0
Steve Evans
Top achievements
Rank 1
answered on 16 Jun 2010, 02:31 PM
sorry, further to my previous post I have seen that in the April release notes there is the following:

RadTabControl

What’s New:

  • Make TabItem's data context propagation optional.

I would be really grateful if somebody could just explain this in a little detail please.

Thanks, Steve
0
Steve Evans
Top achievements
Rank 1
answered on 16 Jun 2010, 02:38 PM
apologies once again, I was being thick and have found the new PropagateItemDataContextToContent property and which when set to false causes my issue to go away.

Thanks, Steve
0
Tina Stancheva
Telerik team
answered on 16 Jun 2010, 02:46 PM
Hi Steve Evans,

I am glad that you got it working.

However, if we can further assist you, do not hesitate to contact us.

P.S: If you want to reduce the size of your Silverlight application, you should check our latest Silverlight tool online - Assembly Minifier (http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx)

Sincerely yours,
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
Daniel Pamich
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Daniel Pamich
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Steve Evans
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or