Hi Jason, I think I have this working as required now with just the one sort method used by every column (I think this is OK as I have multi-column sorting turned off).
I have moved the createColumns() method onto the MyAdvancedDataGrid class and added the following to that class: // map of column objects keyed against their datafields (populated by createColumns() method) private var mColumns:Object; // keep track of currently sorted column private var mSortedColumn:AdvancedDataGridColumn; public function MyAdvancedDataGrid (id:String) { <snip> addEventListener(AdvancedDataGridEvent.SORT, sortEventHandler); } private function sortEventHandler(event:AdvancedDataGridEvent):void { mSortedColumn = mColumns[event.dataField]; } Then within createColumns() every new column gets column.sortCompareFunction = compareExcludeSummaryRow; where the sort method is: private function compareExcludeSummaryRow(obj1:Object, obj2:Object):int { // should never be in this state if (mSortedColumn == null) { // TODO log error return 0; } var isSortDescending:Boolean = mSortedColumn .sortDescending; var sortField:String = mSortedColumn .dataField; if (obj1.summary) { return isSortDescending ? -1 : 1; } else if (obj2.summary) { return isSortDescending ? 1 : -1; } else if (obj1[sortField] < obj2[sortField]) { return -1; } else if (obj1[sortField] > obj2[sortField]) { return 1; } else { return 0; } } This seems to work nicely now, but as I say I think it is restricted to single column sorting, which is fine for me. Thanks for your help, and any further comments appreciated! Dan. Pan Troglodytes wrote: > > Sorry Dan, my brain must not have been fully in gear. You do need to > check > the columns sort order: > > if (obj1.summaryRow) > return col1.sortDescending ? -1 : 1 > else if (obj2.summaryRow) > return col1.sortDescending ? 1 : -1 > else if (obj1.value < obj2.value) > return -1 > else if (obj1.value > obj2.value) > return 1 > else > return 0; > > Where col1 is the id of the column being sorted. That should (hopefully) > do > it. > -- View this message in context: http://www.nabble.com/AdvancedDataGrid%3A-Exclude-last-row-from-sorting-tp19458035p19511454.html Sent from the FlexCoders mailing list archive at Nabble.com.