Flex align checkbox in datagrid Flex
Instead of using <mx:Box />
, use <mx:Canvas />
or <s:Group />
(in Flex 4).
Also, set the horizontalCenter="0"
on the checkbox.
For example:
<mx:itemRenderer>
<mx:Component>
<mx:Canvas width="100%" height="100%">
<mx:CheckBox selected="{data.visibleInd}" horizontalCenter="0" />
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
Simply use DataGridColumn's textAlign
Style:
<mx:DataGridColumn headerText="Visible" textAlign="center">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox selected="{data.visibleInd}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>