Content disappears after overlapped by other view

7 posts, 0 answers
  1. YongKoo Kang
    YongKoo Kang avatar
    101 posts
    Member since:
    Jan 2010

    Posted 25 Feb 2012 Link to this post

    Hi telerik,

    I placed a usercontrol in contentpresenter of RadTileView as you advised in this thread
    instead of Prism region.  Follwing is snippet of xaml in layoutview which has tileview control.
    /// resource
     <DataTemplate x:Key="LineContentTemplate">
                    <ContentPresenter Content="{Binding View, Mode=OneWay}" />
     </DataTemplate>
     
    /// tileview
     <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource popLineCurrentViewModelViewSource}}">
            <telerik:HeaderedContentControl Style="{StaticResource SchFormBaseStyle}">
                    <telerik:RadTileView x:Name="lineTagView" ItemsSource="{Binding ChildVM}"
                                     ContentTemplate="{StaticResource LineContentTemplate}"
                                     Style="{StaticResource tileViewStyle}"
                                     MinimizedColumnWidth="300" MinimizedRowHeight="270">

    When opened view first time in documenthost of RadDock, everything is fine as attached first image.
    However,after open another view over tileview and then return to tileview by tab click,
    contents are gone as attached second image.
    The code to create usercontrol in viewmodel is as follows which borrowed in your various sample.
    private FrameworkElement _view;
         public FrameworkElement View
         {
             get
             {
                 SetView();
                 DetachFromVisualParent(_view);
                 return _view;
             }
         }
     
         protected void DetachFromVisualParent(FrameworkElement visual)
         {
             var parent = System.Windows.Media.VisualTreeHelper.GetParent(visual) as ContentPresenter;
             if (parent != null)
             {
                 parent.Content = null;
             }
         }

    However, in case dataTemplate has all controls declared in same xaml, it runs fine without disappearing.
    I've tried to debug if the view or Itemsource of tileview control changes when tilew view has focus again,
    but can't configure and find it. Currently IsVirtualization is set ON, but it was same when changed to  OFF.
    What am I missing something ? Pls advise me.

    Thank you in advance.

    Kang

  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 29 Feb 2012 Link to this post

    Hi,
    Thank you for the feedback! From your explanation I guess that you've encountered this issue (in the PITS it is about TransitionControl but it's the same with the TabControl). The problem occurs if you have UserControl(s) in the templates and as you've correctly noticed if you place all the XAML in the DataTemplate everything should work ok, so for now this is the best workaround that we know of.
    We'll try to fix this issue in some of our next internal releases and if you have more questions please feel free to ask.

    Greetings,
    Zarko
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Peter
    Peter avatar
    9 posts
    Member since:
    Jun 2010

    Posted 22 Mar 2012 Link to this post

    Is there an update on when this will be fixed?  We are seeing the same issue as well.  Thanks.
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 23 Mar 2012 Link to this post

    Hello,
    I'm glad to tell you that this bug should be fixed in our Q1 2012 SP which is scheduled for next week.
    If you have more questions please feel free to ask.

    All the best,
    Zarko
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Peter
    Peter avatar
    9 posts
    Member since:
    Jun 2010

    Posted 29 Mar 2012 Link to this post

    This is not fixed for us on version 2012.1.326.1050.  Item headers and Item content disappear when scrolling or maximizing/restoring. It might be a different problem.  I submitted a support ticket (528483) with a sample project attached.  Perhaps we are doing something incorrectly in the way we have structured our docking/tileview markup.  Either way, it would be great to get this fixed as soon as possible.
  7. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 30 Mar 2012 Link to this post

    Hi Peter,
    I'll post the answer from the support ticket here, so that anyone with similar problems may see it:
    "In your case the Content and the Header of your items disappear because you've set the IsVirtualizing to True. The virtualization is meant to work when you use business items in your RadTileView and you've bound their properties in the Content/ItemTemplate, but when you're using directly RadTileViewItems you don't need virtualization because you've already created all of the containers (the RadTileViewItems).
    I've attached a sample project that uses business items so you could examine it and see that the Header and the Content are not lost.
    If you need further questions please feel free to ask."


    Greetings,
    Zarko
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  8. Peter
    Peter avatar
    9 posts
    Member since:
    Jun 2010

    Posted 30 Mar 2012 Link to this post

    It is curious that this setting would cause harm in this case, but the change worked for us.  Thank you!
Back to Top
DevCraft banner