Setting background color for datagrid row in Adobe Flex

前端 未结 5 904
孤独总比滥情好
孤独总比滥情好 2020-12-04 02:22

I need to programmatically change the background color for a single row in a datagrid in Flex. I\'ve scoured the Net and found reference to \"dg.setPropertiesAt,\" which is

5条回答
  •  难免孤独
    2020-12-04 02:46

    I managed it by extending the DataGrid class and creating my own method, like this:

    public function paintRow(rowNumber:Number,color:uint):void{
    var rowBGs:Sprite=Sprite(listContent.getChildByName("rowBGs"));
    drawRowBackground(rowBGs,rowNumber,listContent.rowInfo[rowNumber].y,listContent.rowInfo[rowNumber].height,color,null);
    }
    

    This was inspired by the drawRowBackgrounds method of the datagrid class.

    Hope it helps.

提交回复
热议问题