RadTileView locked tiles do not rearrange when item is removed, causing unexpected behavior

4 posts, 1 answers
  1. Thomas
    Thomas avatar
    7 posts
    Member since:
    Oct 2011

    Posted 06 Oct 2011 Link to this post

    I have a RadTileView whose ItemsSource is an ObservableCollection of a class.

    Say I populate the collection with 9 items and set the Colums to 3 and set the RowHeight to a set size (giving the scroll). This results in a 3x3 RadTileView. Now, starting in the upper right and reading by rows, the first five tiles are "unlocked" (OnPreviewPositionChanged sets e.Handled to false) and the last four are "locked" (e.Handled is set to true). When one of the items in the RadTileView ItemsSource collection is removed (MyCollection.Remove(MyClassObject), the unlocked tiles rearrange themselves but the locked ones will not. This leaves ugly gaps in the grid that do not behave well when maximizing and minimizing. The wrong tile will maximize when you try to maximize a tile below the gap.

    Is this a known issue? Is there a work-around besides repopulating the collection completely? My tile views contain some slow-performing RadCharts and refreshing all of them when the user removes one tile is an unacceptable user experience. I also tried flagging the RadTileView before and after the item remove so that I could read the flag in OnPreviewPositionChanged, but I ran into very complex problems that I think may be thread safety issues, so I'm hoping someone can provide a more straight-forward solution.

    Thanks.

    - Thomas.
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 11 Oct 2011 Link to this post

    Hi Thomas,

     We prepared a project for you that demonstrates a possible solution for this scenario. The key thing is to avoid using the PreviewTilePositionChanged event handler immediately after the remove operation. Please check it out and let us know if it satisfies you.

    Greetings,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 11 Oct 2011 Link to this post

    Hi Thomas,

     Since there are some changes in the RadTileView comparing the Official Q2 and SP versions, the suggested solution in the previous post works only for the SP. Now we prepared a project that both works with 0712 (Q2) and 0920 (SP) versions. Please check it out and let us know if it satisfies you.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Thomas
    Thomas avatar
    7 posts
    Member since:
    Oct 2011

    Posted 11 Oct 2011 Link to this post

    Thank you, Petar. This worked perfectly for me.
Back to Top