Radtabcontrol changing child field datacontext fields

8 posts, 0 answers
  1. Daniel Pamich
    Daniel Pamich avatar
    3 posts
    Member since:
    Nov 2009

    Posted 29 Mar 2010 Link to this post

    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



  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 31 Mar 2010 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Daniel Pamich
    Daniel Pamich avatar
    3 posts
    Member since:
    Nov 2009

    Posted 12 Apr 2010 Link to this post

    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

  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 15 Apr 2010 Link to this post

    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.
  6. Steve Evans
    Steve Evans avatar
    23 posts
    Member since:
    May 2010

    Posted 16 Jun 2010 Link to this post

    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
  7. Steve Evans
    Steve Evans avatar
    23 posts
    Member since:
    May 2010

    Posted 16 Jun 2010 Link to this post

    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
  8. Steve Evans
    Steve Evans avatar
    23 posts
    Member since:
    May 2010

    Posted 16 Jun 2010 Link to this post

    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
  9. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 16 Jun 2010 Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready