I am using the following code to highlight a cell:
override protected function updateDisplayList(unscaledWidth:Number, 
unscaledHeight:Number):void
                {
                        super.updateDisplayList(unscaledWidth, 
unscaledHeight);        
                        var blockNum:int = data.columnIndex + 1;
                        var grid1:DataGrid = DataGrid(DataGridListData
(listData).owner);
.....
if (grid1.isItemSelected(data))
{
        storeBackgroundCell = getStyle("backgroundColor");
        if (g == null)
        {
                g = graphics;
        }       
        if (data["plan" + blockNum] == 1)
        {
                g.clear();
                g.beginFill(0xe1dc4d);
                g.drawRect(0, 0, unscaledWidth, unscaledHeight + 1);
                g.endFill();
        }
                if (data["plan" + blockNum] == 2)
                {
                        g.clear();
                        g.beginFill(storeBackgroundCell);
                        g.drawRect(0, 0, unscaledWidth,unscaledHeight 
+ 1);
                        g.endFill();            
                }
        }
}
What happens is that code will highlight all cells in the grid. Why 
is that?

Thanks

Reply via email to