locked
How to create e GridView with 2 columns and 3 rows? RRS feed

  • Question

  • Hello, how can I create a GridView with 2 columns and 3 or N rows?

    In the ItemsPanel I only find the MaximumRowsOrColumns property, so I can only make 2x2, 3x3, NxN GridViews... :(

    I expected to find something like this:

     <ItemsPanelTemplate x:Key="ShowcaseGridRowPanel">
    
    
            <ItemsWrapGrid Orientation="Vertical" MaximumRows="3" MaximumColumns="2" />
        
    
    </ItemsPanelTemplate>

    How can I do?


    Thursday, January 23, 2014 5:03 PM

Answers

  • The MaximumRowsOrColumns property tells the ItemsWrapGrid when to Wrap, so the panel will start laying out items vertically because of the orientation and wrap when it hits MaximumRowsOrColumns items.  You need to set Orientation = Horizontal and MaximumRowsOrColumns = 2, this will lay out the first two items in the first row and then begin wrapping to the second row and so on.

    Please mark this post as answered if this answers your questions

    Terry


    Terry

    • Marked as answer by Dr Doctor Friday, January 24, 2014 12:13 AM
    Thursday, January 23, 2014 5:19 PM

All replies

  • The MaximumRowsOrColumns property tells the ItemsWrapGrid when to Wrap, so the panel will start laying out items vertically because of the orientation and wrap when it hits MaximumRowsOrColumns items.  You need to set Orientation = Horizontal and MaximumRowsOrColumns = 2, this will lay out the first two items in the first row and then begin wrapping to the second row and so on.

    Please mark this post as answered if this answers your questions

    Terry


    Terry

    • Marked as answer by Dr Doctor Friday, January 24, 2014 12:13 AM
    Thursday, January 23, 2014 5:19 PM
  • Thank you :))
    Friday, January 24, 2014 12:13 AM