Sorry, forgot to provide my sortable DataGrid:
package CustomComponents

{

import mx.collections.*;

import mx.controls.DataGrid;

import mx.controls.dataGridClasses.*;

import mx.events.DataGridEvent;

public class sortableDataGrid extends DataGrid

{

public function sortableDataGrid()

{

super();

addEventListener("headerRelease", headerReleaseHeandler);

}

public var sortIndex:int = -1;

public var sortColumn:DataGridColumn;

public var sortDirection:String;

public var lastSortIndex:int = -1;

public var col:String;

public function headerReleaseHeandler(event:DataGridEvent):void

{


col = columns[event.columnIndex].dataField;


}

}

}




--- In flexcoders@yahoogroups.com, "markgoldin_2000" <markgoldin_2...@...> 
wrote:
>
> Here is what I am doing.
> column definition:
> <mx:DataGridColumn headerText="Block" dataField="tcbkcd" 
> sortCompareFunction="sortNumericColumnTrackTotal"/>
> and:
> private function sortNumericColumnTrackTotal(itemA:Object, itemB:Object):int
> {
> return ObjectUtil.numericCompare(itemA[TrackTotal.col], 
> itemB[TrackTotal.col]);
> } 
> 
> where TrackTotal is a DG's id.
> 
> HTH
> 
> --- In flexcoders@yahoogroups.com, Angelo Anolin <angelo_anolin@> wrote:
> >
> > 
> > Hi.
> > 
> > I am quite new in Flex and would like to ask a simple question.
> > 
> > I am retrieving datasets from a .NET webservice and binding the same to a 
> > datagrid.  The datagrid comes with a feature that when you click on any of 
> > the headers, the column is sorted ASC or DESC.
> > 
> > Now, one column which I am binding to is originally a numeric column.  But 
> > when it binds to the datagrid, it's data type becomes string.  Is it 
> > possible that prior to binding the said column to the datagrid, I would be 
> > able to convert it back to its numeric data taype?  Since sorting the 
> > column in a string format would give a different result as compared to 
> > sorting the same column in a numeric format.
> > 
> > Thanks.
> > 
> > Regards.
> >
>


Reply via email to