Cgridview invalid pagination and Count Summary


I have a table contain posters of different users. Currently I have 20 records thats working fine.

Then i used distinct with user id, grid result showing only five records that is currect. but the issue is the pagination showing second and count showing 20 records

My code snippet is comes here

	$criteria=new NewCDbCriteria;





		$datProvider = new CActiveDataProvider($this, array(



Try with

$criteria->group = 'UserId';

Yes now its working :). But distinct showing error count, that is isssue