Cgridview (Datas) - Group By Months


I have a problem with CGridView.

In database everyday is adding new row- date ( today "2013-01-10", tomorrow "2013-01-11", …) and

CGridView show all datas in one list (divide to pages on 10 row). I want group this list by month- one month = one page.

For example:

First page:



(22 rows)

Second page:



(28 rows)

Any ideas?


I don’t think there’s an easy way to do that within the grid view. The best way might be to disable pagination entirely on the grid view and let the user choose the month another way (links or a drop down). If you keep the month selection in the URL, the user will be able to bookmark the page.

Then, fetch just the selected month’s data from the database and feed it into the grid view.