@(Html.EJ().Grid<MVCSampleBrowser.Models.EditableOrder>("FlatGrid")
.Datasource(Model)
-----------------------------
.FilterSettings(filter => { filter.FilterType(FilterType.Menu); })
-------------------
.Columns(col =>
{
col.HeaderText("Action").Commands(command =>
{
command.Type("details").ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
{
Text = "Visualiser",
Click = "onViewClick",
Width = "80px"
}).Add();
}).TextAlign(TextAlign.Center).AllowFiltering(false).AllowSorting(false).Width(115).Priority(1).Add();
col.Field(p=> p.OrderID).HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(90).ValidationRules(v => v.AddRule("required", true).AddRule("number", true)).Add();
col.Field(p => p.CustomerID).HeaderText("Customer ID").TextAlign(TextAlign.Left).Add();
col.Field(p=> p.Employee_ID).HeaderText("Employee ID").TextAlign(TextAlign.Left).Add();
col.Field(p=> p.Ship_City).HeaderText("Ship City").TextAlign(TextAlign.Left).Add();
col.Field(p=> p.Freight).HeaderText("Freight").TextAlign(TextAlign.Left).Format("{0:C}").Add();
})
)
|
.Columns(col =>
{
----------------------------------
col.Field(p => p.CustomerID).HeaderText("Customer ID").TextAlign(TextAlign.Left).Add();
col.Field(p=> p.Employee_ID).HeaderText("Employee ID").TextAlign(TextAlign.Left).Type("number").Add();
col.Field(p=> p.Ship_City).HeaderText("Ship City").TextAlign(TextAlign.Left).Type("string").Add();
col.Field(p=> p.Freight).HeaderText("Freight").TextAlign(TextAlign.Left).Format("{0:C}").Add();
})
|