I want to know how i set width in percentages of columns of MX datagrid in flex ?
Thanks
Alternatively to Jason Sturges' answer, you can actually just put in decimals and the datagrid figures it out.
<mx:DataGridColumn width="0.4" />
would be 40%.
You can NOT mix and match with fixed widths. All columns must add up to 1.
Example:
<mx:DataGridColumn width="0.4" />
<mx:DataGridColumn width="0.6" />
This adds up to 100%.
You could calculate percent based upon width in the property attribute:
40%
<mx:DataGridColumn width="{0.4 * width}" />
60%
<mx:DataGridColumn width="{0.6 * width}" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.