I want to remove the highlight that occurs when mou开发者_开发技巧se over occurs on the headers of a DataGrid.
If you don't need sorting on that column, just set sortable to false, and it won't get highlighted on mouse over.
Maybe the following hack will help someone. I simply wanted to remove the rollover and selection from datagrid header (flex 3).
What I made:
1) Create a new subclass of DataGridHeader and override drawHeaderIndicator and drawSelectionIndicator
package
{
 import flash.display.Sprite;
 import mx.controls.dataGridClasses.DataGridHeader;
 import mx.controls.listClasses.IListItemRenderer;
 public class MyDataGridHeader extends DataGridHeader
 {
  public function MyDataGridHeader()
  {
   super();
  }
  override protected function drawHeaderIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void
  {
  }
  override protected function drawSelectionIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void
  {
  }
 }
}
2) Create a new subclass of DataGrid - lets say MyDataGrid and in constructor do the following:
public function MyDataGrid()
  {
   super();
   this.mx_internal::headerClass = MyDataGridHeader;
   ....
  }
This will force DataGrid to use your DataGridHeader.
This might help you:
http://jcraane.blogspot.com/2009/10/flex-how-to-create-different-rollover.html
Basically what I've found is that you can't just change it. It requires extending the header class and a whole bunch of other stuff I don't know how to do yet.
dont forget to add this import at MyDataGrid file
import mx.core.mx_internal;
works perfectly thanks.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论