RadTileViewItem collection order after dragging

3 posts, 1 answers
  1. Patrick
    Patrick avatar
    43 posts
    Member since:
    Jan 2013

    Posted 16 May Link to this post


    What is the best way to get the full collection of bound items in the current order as they appear as RadTileViewItems? The ObservableCollection order does not update after dragging. Perhaps we are missing something obvious.

    Some notes on our use of RadTileView:

      -We use a RadFluidContentControl in a datatemplate as the RadTileView's 'ContentTemplate'

      -RadTileView.ItemsSource is set to an ObservableCollection, adds and removes work great.

      -Virtualization is on, sometimes we have hundreds of items.

    We've almost got what we needed using RadTileView.ItemContainerGenerator.ContainerFromIndex(i) in a for loop and examining the Position property of the RadTileViewItem, but this only provides a small subset of the collection because of the virtualization.

    Please advise, thank you,


  2. Answer
    Martin avatar
    1042 posts

    Posted 19 May Link to this post

    Hi Patrick,

    RadTileView doesn't reorder its children collection when the positions of the RadTileViewItems are changed at runtime. Instead, each item has a Position property which stores the item's current position in the panel. In order to achieve your requirement you can define a Position property in your view model and bind it to the Position of RadTileViewItem with in a TwoWay mode. This way you will have access to the position of an item even if its not in the view port and its container is not generated. You can find this approach demonstrated in the attached project. Please give it a try and let me know if it works for you.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
  4. Patrick
    Patrick avatar
    43 posts
    Member since:
    Jan 2013

    Posted 31 May in reply to Martin Link to this post


    Thank you for the succinct example, it works perfectly.


Back to Top