Dynamic Columns

In a data grid, I'm displaying a few attributes as columns of an entity. Now I have to extend the data-grid columns dynamically(there could be one or more columns that need to be added) from an associated entity. How do we achieve this behavior? one row in the associated entity should be a new column. the associated entity will have only one attribute.
2 answers

Not exactly clear what you are after. If you are looking to add a dynamic amount of rows and columns based on data (objects), then you could either look at an option to have a list view within a list view (and style as columns and rows), or take a look at this widget.



Hi Nikhil, 

There is no direct way for this problem. 

We had tried to solve this by adding dynamic class to a column and control visibility but it didn't work for us.. 

The dirty work around solution we had to implement was to determine possible columns prior opening the page with datagrid 2 and hide and show the datagrids based on the no of columns.. i e say if there can be maximum 10 columns in a page we have 10 data grids with various number of columns.. based on the number of columns to be visible we show that grid.


Looking forward to see a nice work around solution for this.