Magento – Custom Sort Order For Collection

collection;magento-1.7modelresource-modelsorting

I need to sort a collection based on "sort_order" field instead of "id" as shown in the image.
enter image description here

$collection=Mage::getResourceModel('banners/manage_collection');
$collection->getSelect()->order('sort_order','DESC');

And

I have tried this but its always returns collection based on id field.

Best Answer

You can add this code in the __construct method of your grid block after calling parent::__construct();:

$this->setDefaultSort('sort_order');
$this->setDefaultDir('ASC'); 

EDIT:
For frontend you can use this:

$collection = Mage::getResourceModel('banners/manage_collection');
$collection->setOrder('sort_order','DESC');