RadWrapPanel with non-grid-like behavior

2 posts, 0 answers
  1. Musashi
    Musashi avatar
    23 posts
    Member since:
    Jan 2014

    Posted 09 May 2014 Link to this post

    I'm sure the title is not the best at describing what I'm looking for...
    Default behavior works like a grid where if in one row, a cell contains a large thing, the entire row must be that height.
    The behavior I'm looking for is for a wrap panel to place items within it left-to-right first, then top-to-bottom, but more as a bucket then a grid.
    For example,if the wrap panel has width of 2, and the first item is of width 1 and height 2, and the second and third item are of 1x1, then the default placement would be first item on top left, second item top right, and third item below the first.
    What I'm looking for is first item on top left, second and third item both to the right of the first item.

    Is this possible? Or should I be looking at a different control maybe?
  2. Nick
    Nick avatar
    593 posts

    Posted 14 May 2014 Link to this post

    Hi Musashi,

    RadVirtualizingWrapPanel aims to behave like an ordinary wrap panel, but offer a UI virtualization at the same time, in order to boost performance in more heavy scenarios. 
    The requirement you have includes various arrange patterns and sizes which are not supported by RadVirtualizingWrapPanel. You have a couple of options in this case. 
    The first one is to inherit from RadVirtualizingWrapPanel and implement your own Measure and Arrange logic which will override the default one. This is a solution that is as good as creating your own panel, since most of the Arrange logic is in Measure and Arrange overrides. 

    The second approach can be used if you don't need UI virtualization. You can use an UniformGrid, which can arrange the items the way you configure it which will probably cover the requirements you have. 

    Let me know if I can provide any additional information. 

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top