How to show relational data in dataGrid Widget?

I have two tables "Orders" and "Customers", How can I show data using dataGrid Widget?

I am also using "EActiveDataProvider" extension and doing

              $dataProvider=new EActiveDataProvider('Orders', array(


		 


		// 'scopes'=>array('charged'),


		 'criteria'=>array(


			 //'condition'=>'status=1 AND tags LIKE :tags',


			 //'params'=>array(':tags'=>$_GET['tags']),


			 'with'=>array('customers'),


		 ),


			 'pagination'=>array(


			 'pageSize'=>20,


			),


	 ));


	 $dataProvider->joinAll = true; // optional if you want to also join the *_MANY relations


	 $dataProvider->getData(); // will return a list of customers objects


	


	return $dataProvider;

and in view If I want to show Email from customers table, it shows error

<?php $this->widget(‘zii.widgets.grid.CGridView’, array(

'id'=&gt;'orders-grid',


'dataProvider'=&gt;&#036;model-&gt;fetchData(),


'filter'=&gt;&#036;model,


'columns'=&gt;array(


	'ID',


	'FirstNameB',


	'LastNameB',


	'Email',

Any suggestion will be highly appreciated

Could you give us the error that’s appearing, please?

The reason for the error is most likely because ‘Email’ is not a column in your orders table.

I’m not familiar with the EActiveDataProvider extension.

In the ‘columns’ array of your CGridView, try this:


'columns'=>array(

....

array(

  'name'=>'email',

  'value'=>'$data->customer->email',

)

),

in place of the ‘Email’ entry you have in your code sample.

Thanks but you are too late, I got solutions far earlier.

Can you post the solution here, so other people can learn?

OK, Here is what I did… This will fetch data from orders and customers tables.

$this->widget(‘zii.widgets.grid.CGridView’, array(

‘dataProvider’=>$model->search(),

‘filter’=>$model,

‘columns’=>array(

    'ID',          // display the 'ID' attribute


    'Amount',          // display the 'Amount' attribute


//'customers.FirstNameB',  // show attribute  'FirstNameB' from 'customers' relation


//'customers.LastNameB',  // show attribute  'LastNameB' from 'customers' relation


'customers.Email',  // show attribute  'Email' from 'customers' relation


    //'content:html',   // display the 'content' attribute as purified HTML


    array(            // display 'create_time' using an expression


        'name'=&gt;'Time',


        'value'=&gt;'date(&quot;M j, Y&quot;, &#036;data-&gt;Time)',


    ),


    array(            


        'name'=&gt;'CustomerID',


        //'value'=&gt;'&#036;data-&gt;customers-&gt;FirstNameB',


    'filter' =&gt; CHtml::listData(Customers::model()-&gt;few()-&gt;findAll(),'ID','FirstNameB'),


    'value' =&gt; 'Customers::model()-&gt;FindByPk(&#036;data-&gt;CustomerID)-&gt;FirstNameB',


    ),


    array(            // display a column with &quot;view&quot;, &quot;update&quot; and &quot;delete&quot; buttons


        'class'=&gt;'CButtonColumn',


    ),


),

));