GridView from new models not yet saved in database

I want to display a gridview of ActiveRecord models that have not yet been saved. These models are stores in a session array and I would like to display them before they are saved in the DB. I have tried a few things and looked for a solution but I have not been able to accomplish this.

Has anyone else ever done this or do you know if this is possible?

Thanks.

It’s impossible as long as you are using ActiveDataProvider or SqlDataProvider for providing data to the gridview, since these data providers retrieve data from db.

Try using ArrayDataProvider instead.