Item location

2 posts, 0 answers
  1. Shlomy
    Shlomy avatar
    2 posts
    Member since:
    Jul 2010

    Posted 02 Sep 2010 Link to this post

    How can I control the location of an item on the screen?

    I have a RadTileView control binded to an ObservableCollection. I want to set the location of each item based on the order of the items in the collection. At some point, I would like to replace an object in the collection with another object, I do make sure it will be on the same index but in the RadTileView control I see the new object added as the last item.

  2. Tina Stancheva
    Tina Stancheva avatar
    3298 posts

    Posted 07 Sep 2010 Link to this post

    Hello Shlomy,

    When the RadTileView is databound it orders its items accordingly to the order of the items in its source collection.

    Also by design the control reorders its items whenever its data source changes. Therefore when you try to replace an item ( I suppose by deleting the old one and adding a new one), the RadTileView reorders its items immediately after the old item is removed thus filling the available positions and when the new item is inserted in its place, it cannot be placed on the position of the removed item since that position is already filled. This is why the newly added items are always displayed as last.

    Therefore in order to replace a tile with a new one, you will have to use a temporary collection to hold the source collection. Then you can apply the changes to that temp collection and then update the source collection. I attached a sample project illustrating this approach.

    Also, there is a PITS item associated with this issue and you can vote for it here thus increasing its priority.

    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
  3. DevCraft banner
Back to Top