Proportional Sizing (star sizing)

When a single row’s height or column’s width is set to *, it occupies all the remaining space.

When multiple rows or columns use *, the remaining space is divided equally between them.

Rows and columns can place a coefficient in front of the asterisk (like 2* or 5.5*) to take proportionately more space than other columns using the asterisk notation. A column with width 2* is always twice the width of a column with width * (which is 1*) in the same Grid. 

Percentage Sizing

Stretch = 100%

Otherwise you need to use the * star sizing, percentage values are not supported.

Grid cells background colour, padding, borders, etc

Background color and border

Add a Rectangle which stretches to fill the cell with the fill and stroke (border) you want.  Or you can use a Border element and set its BorderBrush appropriately (gives better performance).  Be sure to add these to the grid before adding any of the other children (or explicitly mark them with the ZIndex attached property), so their Z order puts them behind the main content.

Cell padding

Use autosizing and set the Margin on the child element.



We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.


Your email address will not be published.