1 Reply Latest reply on Aug 30, 2007 6:44 AM by mae@ccg

    DataGridColumn backgroundColor

    mae@ccg
      When I hide a datagridcolumn that has a background color, the background color remains "underneath" the remaining visible columns.

      For example, run this and click the "toggle" button:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      private function toggleView():void
      {
      col4.visible = !col4.visible;
      col5.visible = !col5.visible;
      col6.visible = !col6.visible;

      }
      ]]>
      </mx:Script>
      <mx:DataGrid height="323" right="10" left="10" top="10">
      <mx:columns>
      <mx:DataGridColumn id="col1" backgroundColor="#FFFFFF" headerText="Column 1" dataField="col1"/>
      <mx:DataGridColumn id="col2" backgroundColor="#FFFFFF" headerText="Column 2" dataField="col2"/>
      <mx:DataGridColumn id="col3" backgroundColor="#FFFFFF" headerText="Column 3" dataField="col3"/>
      <mx:DataGridColumn id="col4" backgroundColor="#FFFFFF" headerText="Column 4" dataField="col4"/>
      <mx:DataGridColumn id="col5" backgroundColor="#FFFFFF" headerText="Column 5" dataField="col5"/>
      <mx:DataGridColumn id="col6" backgroundColor="#FFCCFF" headerText="Column 6" dataField="col6"/>
      </mx:columns>
      </mx:DataGrid>
      <mx:Button x="10" y="341" label="Toggle View" click="toggleView()"/>
      </mx:Application>

      Is there a way to force the datagrid to redraw?