-
Notifications
You must be signed in to change notification settings - Fork 1
/
GridViewPartial.cshtml
26 lines (21 loc) · 1.14 KB
/
GridViewPartial.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@model System.Collections.IEnumerable
@Html.DevExpress().GridView(settings => {
settings.Name = "GridView";
settings.KeyFieldName = "ProductID";
settings.CallbackRouteValues = new { Controller = "Home", Action = "GridViewPartial" };
settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Home", Action = "GridViewAddNewPartial" };
settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Home", Action = "GridViewUpdatePartial" };
settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Home", Action = "GridViewDeletePartial" };
settings.CommandColumn.Visible = true;
settings.CommandColumn.ShowEditButton = true;
settings.CommandColumn.ShowNewButton = true;
settings.CommandColumn.ShowDeleteButton = true;
settings.CommandColumn.SetHeaderCaptionTemplateContent(c => {
ViewContext.Writer.Write(Html.AntiForgeryToken().ToHtmlString());
ViewContext.Writer.Write("#");
});
settings.Columns.Add("ProductID");
settings.Columns.Add("ProductName");
settings.Columns.Add("UnitPrice");
settings.Columns.Add("UnitsOnOrder");
}).Bind(Model).GetHtml()