Flex中如何通过headerStyleName和color样式设置DataGrid头部列文本颜色的例子
By Minidxer | June 26, 2009
接下来的例子演示了Flex中如何通过headerStyleName和color样式,设置DataGrid头部列文本颜色。
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application name="DataGrid_headerStyleName_color_test"
- xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:Style>
- .myHeaderStyles {
- color: red;
- fontWeight: bold;
- }
- </mx:Style>
- <mx:Array id="arrDP">
- <mx:Object c="1" c1="One" c2="Two" c3="Three" />
- <mx:Object c="2" c1="One" c2="Two" c3="Three" />
- <mx:Object c="3" c1="One" c2="Two" c3="Three" />
- <mx:Object c="4" c1="One" c2="Two" c3="Three" />
- <mx:Object c="5" c1="One" c2="Two" c3="Three" />
- <mx:Object c="6" c1="One" c2="Two" c3="Three" />
- <mx:Object c="7" c1="One" c2="Two" c3="Three" />
- <mx:Object c="8" c1="One" c2="Two" c3="Three" />
- <mx:Object c="9" c1="One" c2="Two" c3="Three" />
- <mx:Object c="10" c1="One" c2="Two" c3="Three" />
- <mx:Object c="11" c1="One" c2="Two" c3="Three" />
- </mx:Array>
- <mx:DataGrid id="dataGrid"
- dataProvider="{arrDP}"
- headerStyleName="myHeaderStyles" />
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
DataGrid |
No Comments » |
1,237 views
Tags: Color, DataGrid, headerStyleName