change column header background color in datagrid

change column header background color in datagrid

Postby haretu » Wed Mar 23, 2011 9:20 am

Adobe flex This example shows how to change column header background color in datagrid
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<mx:Application name="DataGrid_headerColors_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white" viewSourceURL="srcview/index.html">

    <mx:Array id="arr">
        <mx:Object c1="1. One" c2="1. Two" c3="1. Three" />
        <mx:Object c1="2. One" c2="2. Two" c3="2. Three" />
        <mx:Object c1="3. One" c2="3. Two" c3="3. Three" />
        <mx:Object c1="4. One" c2="4. Two" c3="4. Three" />
        <mx:Object c1="5. One" c2="5. Two" c3="5. Three" />
        <mx:Object c1="6. One" c2="6. Two" c3="6. Three" />
        <mx:Object c1="7. One" c2="7. Two" c3="7. Three" />
        <mx:Object c1="8. One" c2="8. Two" c3="8. Three" />
        <mx:Object c1="9. One" c2="9. Two" c3="9. Three" />
    </mx:Array>

    <mx:DataGrid id="dataGrid"
            dataProvider="{arr}"
            headerColors="[red, blue]"
            verticalScrollPolicy="on">
        <mx:columns>
            <mx:DataGridColumn dataField="c1" headerText="Column 1" />
            <mx:DataGridColumn dataField="c2" headerText="Column 2" />
            <mx:DataGridColumn dataField="c3" headerText="Column 3" />
        </mx:columns>
    </mx:DataGrid>

</mx:Application>
Attachments
Screen shot 2011-03-23 at 9.17.56 AM.png
Screen shot 2011-03-23 at 9.17.56 AM.png (20.95 KiB) Viewed 672 times
haretu
 
Posts: 132
Joined: Sat Jan 08, 2011 9:56 pm

Return to Adobe FLEX Flash

Who is online

Users browsing this forum: No registered users and 1 guest

cron