This is a migrated thread and some comments may be shown as answers.

Item location

1 Answer 50 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Shlomy
Top achievements
Rank 1
Shlomy asked on 02 Sep 2010, 11:25 AM
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.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 07 Sep 2010, 03:43 PM
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.

Regards,
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
Tags
TileView
Asked by
Shlomy
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or