Apr 13, 2012, 7:44 PM
Grid
In Razor, I have a gridpanel with this code:
Html.X.GridPanel() _
.ID("MyCedents") _
.Layout(LayoutType.Fit) _
.Width(500) _
.Height(250) _
.Scroll(ScrollMode.Vertical) _
.ColumnModel(Sub(colModel)
colModel.Columns.Add(Html.X.Column() _
.DataIndex("Number").Text("Number"))
colModel.Columns.Add(Html.X.Column() _
.DataIndex("Name").Locked(True).Text("Name"))
End Sub) _
.Store(Sub(dStore)
dStore.Add(Html.X.Store().AutoLoad(True) _
.Model(Sub(mdl)
mdl.Add(Html.X().Model.Fields(Sub(fields)
fields.Add(Html.X.ModelField.Name("Number"))
fields.Add(Html.X.ModelField.Name("Name"))
End Sub))
End Sub) _
.PageSize(10) _
.Proxy(Sub(proxy)
proxy.Add(Html.X.AjaxProxy().Url("/Assignments/TeamMemberCedents/" + MvcApplication.CurrentApplicationUser.EmployeeID.ToString()) _
.Reader(Sub(rdr)
rdr.Add(Html.X.JsonReader().Root("Data"))
End Sub))
End Sub) _
.Sorters(Sub(action)
action.Add(Html.X.DataSorter.Property("Name").Direction(Ext.Net.SortDirection.ASC))
End Sub))
End Sub)
The weird thing is that the grid panel loads, but the columns are not in the order that I have them listed in my column model. The column "Name" shows up first. Can you tell me why? Also, how can I make the columns expand to fill the width of the grid.
Last edited by adelaney; Apr 13, 2012 at 7:53 PM.
Reason: Format the code.