9 Replies Latest reply on Jan 1, 2013 2:13 AM by Kamran Aslam

    Can't change AdvancedDataGrid Header Text Color

    Budkin76

      Hello,

       

      I'm having a really annoying problem styling the AdvancedDataGrid header text colors. With a regular DataGrid you can use a property called "headerStyleName" to set the color of the header text. According to the documentation this style is applicable to AdvancedDataGrid as well. You can see that here:

       

      http://help.adobe.com/en_US/FlashPla...eaderStyleName

       

      Here is a sample app that will show you what I'm talking about. Notice that both grids share the same style but only the normal grid will apply it.

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx">
           
           <s:layout>
                <s:VerticalLayout paddingTop="10"
                                      paddingRight="10"
                                      paddingBottom="10"
                                      paddingLeft="10" />
           </s:layout>
           <fx:Style>
                @namespace s "library://ns.adobe.com/flex/spark";
                @namespace mx "library://ns.adobe.com/flex/mx";
                .headerStyle
                {
                     color: #FF0000;
                     fontWeight: bold;
                }
           </fx:Style>
           <mx:DataGrid width="100%" height="100%" headerStyleName="headerStyle">
                <mx:columns>
                     <mx:DataGridColumn headerText="Header 1" />
                     <mx:DataGridColumn headerText="Header 2" />
                </mx:columns>
           </mx:DataGrid>
           <mx:AdvancedDataGrid width="100%" height="100%" headerStyleName="headerStyle">
                <mx:columns>
                     <mx:AdvancedDataGridColumn headerText="Header 1" />
                     <mx:AdvancedDataGridColumn headerText="Header 2" />
                </mx:columns>
           </mx:AdvancedDataGrid>
           
      </s:Application>

       

      This is driving me nuts as I have to use Advanced data grids because of their added functionality. I would greatly appreciate any solutions to this.