Sorting Value In Cgridview

Hello guys,

any one knows how to sorting value in gridview?

i have some data in one column , the data is numeric. so i want to sort the data in ASC.

what should i do?

just add order to Your criteria, when preparing for DataProvider

$criteria->order = ‘your.field ASC’

In your data provider, you can set defaultOrder properties.

eg. -

$dataProvider = new CActiveDataProvider('Demo', array(


    'defaultOrder'=>'item ASC',