Sep 12, 2013, 10:57 PM
How do I fully dynamic GridPanel from server side?
This is my GridPanel:
consists of columns
but does not rows and values
Information comes from the database
variable number of rows and number of columns
I want to do the attached picture.
Thank you...
<ext:GridPanel runat="server" ID="GridPanel1">
</ext:GridPanel>
This is my server side codes:Store s = new Store();
Ext.Net.Model m = new Ext.Net.Model();
GridPanel1.Store.Add(s);
m.Fields.Add("Column0");
Column cb0 = new Column();
cb0.Text = "";
cb0.DataIndex = "Column0";
GridPanel1.AddColumn(cb0);
List<object[]> rows = new List<object[]>();
foreach (var v in List<T>)
{
m.Fields.Add("Column" + v.Id);
Column cb = new Column();
cb.Text = v.name;
cb.MinWidth = 150;
cb.DataIndex = "Column" + v.Id;
GridPane1.AddColumn(cb);
rows.Add(new object[] { v.name, "", "", "" });
}
s.Model.Add(m);
s.DataSource = rows;
s.DataBind();
Problem:consists of columns
but does not rows and values
Information comes from the database
variable number of rows and number of columns
I want to do the attached picture.
Thank you...