Gridpanel with unknown columns
Hi All,
I am trying to use Gridpanel.I succeed with the example given on the sit.
But in each example no. of columns in Grid is known.
There is a property in Gridview,AutoGenerateColumn = true,so I don't need to specify column names.
(As in my case the columns will be auto generated as per the selection criteria.)
Can I bind a dynamic datatable to Gridpanel/Store?
I tried but it's not working for me.
Please help.
Othe method for add column to Gridpanel dynamically
In addition, I suppose this method is better:
Code:
foreach (DataColumn dc in dt.Columns)
{
Store1.Reader[0].Fields.Add(dc.ColumnName);
Ext.Net.ColumnBase col = new Ext.Net.Column();
col.DataIndex = dc.ColumnName;
col.Width = new Unit("85px");
col.Wrap = false;
col.Sortable = false;
col.Align = Ext.Net.Alignment.Center;
GridPanel1.AddColumn(col);
}