public ActionResult InsertColumn() { Ext.Net.GridPanel grid = this.GetCmp <Ext.Net.GridPanel>("GridPanel1"); DateColumn col = new DateColumn { Text = "Last Updated", Width = 85, Sortable = true, DataIndex = "lastChange", Format = "M/d/yyyy" }; grid.InsertColumn(1, col); return(this.Direct()); }
public ActionResult AddColumn() { Store store = this.GetCmp <Store>("Store1"); Ext.Net.GridPanel grid = this.GetCmp <Ext.Net.GridPanel>("GridPanel1"); ModelField field = new ModelField("pctChange", ModelFieldType.Float); store.AddField(field, 3); store.LoadData(Companies.GetAllCompanies()); Column col = new Column(); col.ID = "pctChangeColumn"; col.Text = "Change %"; col.Width = 75; col.Sortable = true; col.DataIndex = "pctChange"; col.Renderer.Fn = "pctChange"; ComboBox cb = new ComboBox() { ID = "ComboBox1" }; cb.Items.Add(new Ext.Net.ListItem("1", "1")); cb.Items.Add(new Ext.Net.ListItem("2", "2")); cb.Items.Add(new Ext.Net.ListItem("3", "3")); col.Editor.Add(cb); grid.AddColumn(col); return(this.Direct()); }