简体   繁体   中英

Flex Error for alternatingItemColors property of spark datagrid component

I want to set alternate colors to datagrid. I wrote the following code

"<s:DataGrid width="777" horizontalCenter="0" textAlign="center"  id="inv_dg" height="170" alternatingItemColors="#FFFFFF, #000000" fontSize="12" fontFamily="Times New Roman" dataProvider="{obj.rtlist}">"

But it gives me error saying "Cannot resolve alternatingItemColors for spark component datagrid". Also i want to set object value in datagrid but i am not sure if the way i did is correct. It is not working. Please help

For DataGrid: -

Use alternatingRowColors for spark component ie: -

alternatingRowColors="[#FFFFFF, #000000]" 

and alternatingItemColors for mx component ie:-

alternatingItemColors="[#0000FF, #FF0000]".

Hope this may help.

您还需要将属性设置为数组,例如:

[#FFFFFF, #000000]

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM