Hi,
What is the method to set different colors for alternate rows in a flex datagrid? So that two adjacent rows are identified easily?
Hi,
What is the method to set different colors for alternate rows in a flex datagrid? So that two adjacent rows are identified easily?
Use alternatingItemColors
style. You can specify as many colors as you want in the array.
<mx:DataGrid id="dg" alternatingItemColors="[#449933, #994433]"
dataProvider="{[{d:'ASD', c:'$#'},{d:'WER', c:'^@'},{d:'VCB', c:'*!'}]}">
<mx:columns>
<mx:DataGridColumn dataField="d"/>
<mx:DataGridColumn dataField="c"/>
</mx:columns>
</mx:DataGrid>
This style takes effect only if no backgroundColor
is specified.