Thanks. I was able to do as you suggest the function is like
private function selectColumnAt(columnIndex:int):void
{
if (columnIndex > 0)
{
if (_selectedColumnIndex != columnIndex)
{
deselectColumns();
var selectedColumn:DataGridColumn =this.columns[columnIndex];
selectedColumn.setStyle("backgroundColor", "0x7FCEFF");
selectedColumn.setStyle("headerStyleName",
"selectedDataGridHeaderStyle");
_selectedColumnIndex = columnIndex;
}
}
}
The only problem is that I can't change the background color of the column
header.
I have a style defined as
.selectedDataGridHeaderStyle {
fontWeight: "bold";
backgroundColor: "red";
background-color: "blue";
}
The header text changes to bold but the background color doesn't change. Any
ideas?
-Phil
--- In [email protected], Alex Harui <aha...@...> wrote:
>
> Try setting the column's backgroundColor style
>
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.<http://www.adobe.com/>
> Blog: http://blogs.adobe.com/aharui
>
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Felino
> Sent: Thursday, October 01, 2009 10:08 AM
> To: [email protected]
> Subject: [flexcoders] selecting a column in a datagrid
>
>
>
> In a flex datagrid, by default clicking on column headers does sorting. I
> want it such that if a user clicks a column header the entire column is
> selected. I have the datagrid listening for the HEADER_RELEASE event so I
> know when the column header is clicked.
>
> How can I have the column and header appear highlighted similar to how a row
> is highlighted when selected?
>