1 Reply Latest reply on Oct 5, 2007 5:15 PM by Gregory Lafrance

    Setting style  for DatagridColumn?

    mouse jockey
      My dataGrid has a style set for it in the CSS stylesheet. How can I change the style for one of the columns please?
        • 1. Re: Setting style  for DatagridColumn?
          Gregory Lafrance Level 6
          If your DataGridColumn has an id set for it, you can use the setStyle() method to set individual styles.
          <?xml version="1.0"?>
          <!-- dragdrop\SimpleDGToDG.mxml -->
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
          private function initApp():void {
          srcgrid.dataProvider = [
          {Artist:'Carole King', Album:'Tapestry', Price:11.99},
          {Artist:'Paul Simon', Album:'Graceland', Price:10.99},
          {Artist:'Original Cast', Album:'Camelot', Price:12.99},
          {Artist:'The Beatles', Album:'The White Album', Price:11.99}


          <mx:DataGrid id="srcgrid">
          <mx:DataGridColumn id="greg" dataField="Artist"/>
          <mx:DataGridColumn dataField="Album"/>
          <mx:DataGridColumn dataField="Price"/>