Header disappearing when moving TileViewItems to another TileView

4 posts, 0 answers
  1. Thomas
    Thomas avatar
    6 posts
    Member since:
    Mar 2011

    Posted 14 Jan 2013 Link to this post

    Hello,

    we are using Telerik WPF Controls Version Q2 2011 0920.

    We have a scenario where we want to programmatically move TileViewItems from one TileView to another. This is done by removing the item from the RadTileView.Items Collection and adding it to the other in code behind.
    The issue is that the header is disappearing if we do that (plain text defined in XAML with HEADER Property) and is doesn't come back if we move the TileViewItem back to the original TileView.

    Update: Header-Property is correct after the move but the UI isn't showing anything.

    Thanks,

    Thomas
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 15 Jan 2013 Link to this post

    Hello Thomas,
    Thank you for the feedback! There really seems to be a bug in the RadTileView and I've logged it in our PITS under the name "The tileViewItem's Header disappears if you move the item from one tileView to another" and it'll be ready for tracking and voting tomorrow the latest.
    For now there's a possible workaround - save the header before the change and set it back after that:
    if (this.tileViewOne.Items.Count <= 0) return;
     
    var tmpItem = this.tileViewOne.Items[0] as RadTileViewItem;
    var tmpHeader = tmpItem.Header;
    this.tileViewOne.Items.Remove(tmpItem);
    this.tileViewTwo.Items.Add(tmpItem);
    tmpItem.Header = tmpHeader;
    I've updated your telerik account and if you have further questions please feel free to ask.

    Kind regards,
    Zarko
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Thomas
    Thomas avatar
    6 posts
    Member since:
    Mar 2011

    Posted 16 Jan 2013 Link to this post

    As stated in my UPDATE the header property is correctly filled with the defined header, but the UI doesn't show it.
    If I define the same header in the HEADERTEMPLATE I can see the header, but Bindings etc. are gone.
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 18 Jan 2013 Link to this post

    Hello Thomas,
    I'm sorry for the misunderstanding and could I please ask you to tell us how exactly are you using the RadTileView? Do you use it databinding scenario or with XAML defined items, how do you use the HeaderTemplate and the bindings? It'll be best if you could send us some code snippets or a sample project.
    In order for my previous workaround to work you'll have to update it a little bit:
    var tmpItem = this.tileViewOne.Items[0] as RadTileViewItem;
    var tmpHeader = tmpItem.Header;
    this.tileViewOne.Items.Remove(tmpItem);
    this.tileViewTwo.Items.Add(tmpItem);
    tmpItem.Header = null;
    this.Dispatcher.BeginInvoke(new Action(() =>
    {
        tmpItem.Header = tmpHeader;
    }), System.Windows.Threading.DispatcherPriority.SystemIdle);
    Another possible workaround includes custom controlTemplate and I've attached a sample project showing this.
    If you need further assistance please feel free to ask.

    Regards,
    Zarko
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top