c# - Add Ext.Net.Gridpanel in code behind -
i'm trying build several gridpanels result of search in db.
but never appears...
here code, what's wrong ?
edit
ok, got it. have same problem, solved adding gridpanel :
renderto = this.extpanel.clientid
and after build :
ext.gridpanel grid = this.buildgridpanel(forwarder.key, forwarder.value); grid.render(); //this.extpanel.controls.add(grid);
public void addgridpanel() { ext.net.gridpanel g=new ext.net.gridpanel(); ext.net.store store1=new ext.net.store(); model model = new model(); (int = 1; < tas.gettaskde().count / 2; i++) { fields = fields + "," + tas.gettaskde()[i].fieldname; modelfield modelfield = new modelfield(); modelfield.name = tas.gettaskde()[i].fieldname; model.fields.add(modelfield); if (tas.gettaskde()[i].visibility == "true") { g.columnmodel.columns.add(new columnbase[] { new column { text = tas.gettaskde()[i].fieldadname, dataindex = tas.gettaskde()[i].fieldname, flex = 1 }, }); } } sqldatasource s = new sqldatasource(); s.connectionstring =configurationmanager.connectionstrings["connectionstring"].connectionstring; s.selectcommand = query; store1.model.add(model); store1.datasource = s; store1.databind(); g.store.add(store1); g.render(this.form); }
this example of dynamic gridpanel hope helps
Comments
Post a Comment