Gridview Dynamic Change Column Names

Hello everyone.

In my application im calling a WebService and that WS returns a table that i choose in input. With the table i get, i transform it into an ArrayDataProvider to show in a GridView.

What im trying to do is to dynamically change the column names of the table when i want to show another table in the view. One way to do this is creating a view for each kind of table with ajax. But it lacks of escability. I really want one view to show any kind of table with any kind of column names.

Appreciate any tips.

Got the answer. Just need to omit the "column" attribute like:

$this->widget('bootstrap.widgets.TbGridView', array(

    'type'=>'striped bordered condensed',





/*  'columns'=>array(










And it generates a grid with the columns names as the column names of the dataProvider