locked
Grid within a Grid? RRS feed

  • Question

  •  

    Is it wise to have a Grid within a Grid and what are the implications of this?

    Thank you

    Wednesday, July 27, 2011 1:35 PM

Answers

  • Hi. A grid is a layout container, and it's perfectly legitimate to have multiple grids on one page. It's also not a problem to have nested grids. There are hardly any implications. The inner grid will take the space that is granted by the outer grid and the position it has (row, col) in it, and layout its own children accordingly. You can use that to visually structure your page into several parts without any danger. For example, use a top-level grid with two columns to split the page in half, then put another grid into the left column to split the left half into let's say three rows - no problem with that.

    Wednesday, July 27, 2011 1:42 PM
  • It's perfectly fine to have nested layouts.  One suggestion is to use the appropriate layout and to ensure that you keep the depth of nested layouts to a minimum for performance reasons. If you only need one element, you can either use a Border to store the element or directly use the element.   The performance change is very minimal on desktop apps but can be significant on mobile apps.

    Wednesday, July 27, 2011 1:45 PM

All replies

  • Hi. A grid is a layout container, and it's perfectly legitimate to have multiple grids on one page. It's also not a problem to have nested grids. There are hardly any implications. The inner grid will take the space that is granted by the outer grid and the position it has (row, col) in it, and layout its own children accordingly. You can use that to visually structure your page into several parts without any danger. For example, use a top-level grid with two columns to split the page in half, then put another grid into the left column to split the left half into let's say three rows - no problem with that.

    Wednesday, July 27, 2011 1:42 PM
  • It's perfectly fine to have nested layouts.  One suggestion is to use the appropriate layout and to ensure that you keep the depth of nested layouts to a minimum for performance reasons. If you only need one element, you can either use a Border to store the element or directly use the element.   The performance change is very minimal on desktop apps but can be significant on mobile apps.

    Wednesday, July 27, 2011 1:45 PM