How to display data from two tables in TbGridView using DataProvider?

In this wiki I will show how to display data from two tables in Bootstrap TbGridView using dataProvider.

In your controller/action

public function actionIndex()
    $rawData=Yii::app()->db->createCommand("SELECT as ID, a.first_name as FName, a.last_name as LName, a.status as Status, b.country_name as Country FROM user a LEFT JOIN country_list b ON a.country_id =")->queryAll();  //Also can use where condition for particular use.
	// or using: $rawData=User::model()->findAll();
	$dataProvider=new CArrayDataProvider($rawData, array(
			'ID', 'FName', 'LName', 'Status', 'Country'
			'pageSize'=>10,			//records display


In your view file

        'type'=>'striped bordered condensed',
		'value' =>'($data[Status]==1)? "<span class=\"label label-success\">Active</span>": "<span class=\"label label-important\">Inactive</span>"',

Working fine... for more help please leave a comment.