How to enable Resize on RadTileViewItem by users on the fly?

5 posts, 0 answers
  1. Arfan
    Arfan avatar
    10 posts
    Member since:
    May 2014

    Posted 09 Jul 2015 Link to this post

    Hi,

    How can we enable resizing on the RadTileViewItem? I need to allow users to resize the RadTileViewItem just like the RadWindow control's resizing functionality as described here:

    http://docs.telerik.com/devtools/silverlight/controls/radwindow/features/resizing

    How can we achieve similar functionality in RadTileViewItem? It will be great if you can produce a sample demonstrating the resizing of RadViewItem by users on the fly.

    Thanks,

    Arfan Baig

  2. Arfan
    Arfan avatar
    4 posts
    Member since:
    Jun 2015

    Posted 13 Jul 2015 in reply to Arfan Link to this post

    Any thoughts on this please?
  3. DevCraft banner
  4. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 14 Jul 2015 Link to this post

    Hello Arfan,

    The RadTileView control doesn't support resizing of its items out of the box. In order to achieve such effect you can write custom code. For example, you can create a custom tileview item that derives from RadTileViewItem and implement the resizing logic in the new element's class. I spent some time to prepare an example that demonstrates such implementation, however, keep in mind it is not finished - currently it supports only resizing with the left and right borders of the item. Also, this approach is not well tested and it won't work as expected in some cases. This is why I recommend you to use it only as a base for your implementation.

    Please give the project a try and let me know if it helps.

    Regards,
    Martin
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  5. Arfan
    Arfan avatar
    10 posts
    Member since:
    May 2014

    Posted 14 Jul 2015 in reply to Martin Link to this post

    Hi Martin,

    Thank you for providing the sample, it looks amazing!

    I just have couple of observations. Its not allowing me to re-size vertically (as you already mentioned), is it a lot of work to do to achieve vertical re-sizing? Also, the items vanish if I keep on reducing the size. And the maximized item is not re-sizable. Can you please revise the sample?

    Thank you!

    Regards,

    Arfan Baig

  6. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 16 Jul 2015 Link to this post

    Hi Arfan,

    The vertical resizing behavior should not be hard for implementing. Basically, you can set the top margin of the "MainGrid" in order to resize the item from its top border and the RestoredHeight for the bottom border. However, keep in mind that the resizing functionality itself is not very straightforward task and its implementation will require some of your time.

    About the vanishing item. This happens because there is no check if the item's size and margin are 0 or lower. In order to resolve this you will need to check for this condition when the resize is in progress.
    if(the new size of the item makes him vanish (is 0 or lower))
    {
       // do nothing
    }
    else
    {
        // resize
    }

    I hope this helps.

    Regards,
    Martin
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner