ListBox To TileView With Swap and Placeholder

2 posts, 0 answers
  1. Vivek
    Vivek avatar
    1 posts
    Member since:
    Jun 2013

    Posted 06 Jun 2013 Link to this post

    Hi Telerik Team,

        I need suggestion on moving items from listbox to tileview, in which tileview's drag mode is swap and tileview will contain rows and columns of empty placeholder for example like <div>,when items form listbox dragged and droped on this empty placeholder, this empty placeholder gets replaced with dropped item, and within tileview items interchange in swap mode.

    Vivek Dev
  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1251 posts

    Posted 11 Jun 2013 Link to this post

    Hello Vivek,

    I already answered to this question in your ticket. However, I will post the same answer and attach the same project here, so that others from the community can find it.

    Please note that the RadTileView control does not support empty places. Hence, you are not allowed to define empty spaces like placeholders, out of the box. However, you can achieve your goal by defining two different Styles targeting the RadTileViewItems. First Style should define how your placeholder looks like and the second Style should be the default one. You can change these Styles at runtime based on some custom logic (e.g. a property). As you are going to change Styles at runtime it will be best to use our InplicitStyles in combination with the NoXaml dlls (read more).

    Note that you can change the DataContext of your placeholder items instead of deleting them and adding new RadTileViewItems on their place. Also, you can restrict the drop operation on the ordinary RadTileViewItems. You can achieve this by setting the AllowDrop property of the RadTileView control to False and bind the AllowDrop property of each RadTileViewItem to property of your business object. By doing so, you will be able to control the drop operation form code.

    For your convenience I implemented this approach in the attached project. Please take a look at it and let me know if it works for you.

    Pavel R. Pavlov

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top