Feb 14
Programmaticaly sorting a column in an AdvancedDataGrid
ActionScript, Flex, tips 'n tricks Add commentsHere's a quick tip: If you want to sort a column of an AdvancedDataGrid, without having to set up a sort on the dataprovider, you can dispatch an AdvancedDataGridEvent of type AdvancedDataGridEvent.SORT from the datagrid.
This can be useful if you have a custom sort function on a datagrid column and you want the datagrid to be sorted initially without requiring the user to click the column header.
Actionscript:
-
var sortEvent:AdvancedDataGridEvent = new AdvancedDataGridEvent(AdvancedDataGridEvent.SORT);
-
sortEvent.columnIndex = 0; // first column
-
dataGrid.dispatchEvent(sortEvent);
Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
Christophe Herreman is a software developer living in Belgium. He's working on high-end Flex and AIR solutions at 
Recent Comments