PDA

View Full Version : [CLOSED] Grid Column Width



adelaney
Jun 12, 2012, 7:07 PM
Is there a way to set a grid column's width to be a fixed percentage and not just a fixed pixel size or "flex?" I've tried a variety of the "Cls" properties and seem not to be getting the right combination.

geoffrey.mcgill
Jun 12, 2012, 7:34 PM
Is there a way to set a grid column's width to be a fixed percentage and not just a fixed pixel size or "flex?" I've tried a variety of the "Cls" properties and seem not to be getting the right combination.

A percentage value is not possible. The .Flex property is a proportional value, so it functions the same as a percentage value.

adelaney
Jun 13, 2012, 2:58 AM
I searched on the flex property and understand how it works, but what happens when you mix some columns at a fixed pixel width and have others with a flex setting? How are the column widths calculated?

geoffrey.mcgill
Jun 13, 2012, 4:20 AM
I searched on the flex property and understand how it works, but what happens when you mix some columns at a fixed pixel width and have others with a flex setting? How are the column widths calculated?

First all Columns with a specific .Width are summed. Those Columns will render to the .Width you set.

The total of all .Widths (if set, or 100px by default) is removed from the GridPanel width. The remainder is then proportioned up using any other Column(s) with .Flex values set.



GridPanel .Width = 500

Column1.Width = 50
Column2.Width = 150
Column3.Flex = 2
Column4.Flex = 1

The spacing will look similar to the following:


[ | | | ]

If you were to measure the Columns after rendering, the actual px widths would be:


Column1 = 50
Column2 = 150
Column3 = 2/3 of remainder = 200 (approx)
Column4 = 1/3 of remainder = 100 (approx)

Hope this helps.

adelaney
Jun 13, 2012, 12:44 PM
That was helpful. Thanks.