CArrayDataProvider Sorting Issue

Hi All,

  	Today I stuck at one issue and can not find proper solution. May be with your help, I am able to solve it.

I have created Dataprovider in controller and pass it to view file. It display correct Data. There are total 7 columns to display.

But only on 2 fields sorting is not working and throwing ERROR-500.

In controller File, my Code is :

	$OutboundRatecardDetails_data = OutboundRatecardDetails::model()->findAllByAttributes(array('orc_id'=>$orc_id));





	$pageSize = 10;


	if(isset($_GET['pageSize']))


	{


		$pageSize = $_GET['pageSize'];


		Yii::app()->user->setState('pageSize', (int)$_GET['pageSize']);


		unset($_GET['pageSize']);


	}


		


	$dataProvider=new CArrayDataProvider($OutboundRatecardDetails_data, array(


		'id'=>'orcd_id',


		'sort'=>array(


		'attributes'=>array(


			'orcd_id', 'des_id', 'orcd_duration','orcd_rate','orcd_grace_duration','orcd_description'


		),


		),


		'pagination'=>array(


		'pageSize'=>$pageSize,


		),


		'keyField'=>'orcd_id',


	));


	


	$this->render('index',array(


		'dataProvider'=>$dataProvider,


	));

In admin.php view file, my code is :

	<?php  $this->widget('application.components.widgets.tlbExcelView', array(


		'id'=>'Outbound-rate-card-details-grid',


		'dataProvider'  =>$dataProvider,


		'itemsCssClass' =>'table table-bordered table-striped table-condensed',


		'pagerCssClass' =>'dataTables_paginate paging_bootstrap pagination',


		'htmlOptions'   =>array('class'=>'adv-table'),		  


		'columns'=>array(


			'des_id'=>array(


			'name'=>'des_id',


			'header'=>'Destination',				


			'value' => '(!empty($data->rel_destination->des_prefix) ? $data->rel_destination->des_prefix : "")',


			),





			array(


			'name'=>'orcd_grace_duration',


			'header'=>'Grace Duration',


			'htmlOptions' => array('style' => 'max-width:150px; white-space:normal;word-break:break-all;'),


			),





			array(


			'name'=>'orcd_duration',


			'header'=>'Incr. Duration',


			'htmlOptions' => array('style' => 'max-width:150px; white-space:normal;word-break:break-all;'),


			),





			array(


			'name'=>'orcd_rate',


			'header'=>'Incr. Rate',


			'htmlOptions' => array('style' => 'max-width:150px; white-space:normal;word-break:break-all;'),


			),





			array(


			'name'=>'orcd_min_duration',


			'header'=>'Min. Duration',


			'htmlOptions' => array('style' => 'max-width:150px; white-space:normal;word-break:break-all;'),


			),





			array(


			'name'=>'orcd_min_rate',


			'header'=>'Min. Rate',


			'htmlOptions' => array('style' => 'max-width:150px; white-space:normal;word-break:break-all;'),


			),





			array(


			'name'=>'orcd_description',


			'header'=>'Rate Description',


			'htmlOptions' => array('style' => 'max-width:150px; white-space:normal;word-break:break-all;'),


			),


		),


	)); ?>

When I try to sort on 2nd and 3rd field (orcd_grace_duration,orcd_duration), it throws error (ERROR-500). Other than these 2 fields, sorting is perfectly working.

Eagerly waiting for your reply.

Thank you!!!