-
Notifications
You must be signed in to change notification settings - Fork 1
/
GridViewPartial.cshtml
26 lines (21 loc) · 1021 Bytes
/
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
@Html.DevExpress().GridView(settings =>
{
settings.Name = "gridView";
settings.CallbackRouteValues = new { Controller = "Home", Action = "GridViewPartial" };
settings.KeyFieldName = "ID";
settings.SettingsEditing.Mode = GridViewEditingMode.Batch;
settings.CommandColumn.Visible = true;
settings.CommandColumn.ShowNewButtonInHeader = true;
settings.CommandColumn.ShowDeleteButton = true;
settings.Columns.Add("ID", MVCxGridViewColumnType.TextBox);
settings.Columns.Add("Text", MVCxGridViewColumnType.TextBox);
settings.Columns.Add("Checked", MVCxGridViewColumnType.CheckBox);
settings.CellEditorInitialize += (s, e) =>
{
e.Editor.ReadOnly = false;
(e.Editor as ASPxEdit).ValidationSettings.Display = Display.Dynamic;
};
settings.ClientSideEvents.BatchEditRowDeleting = "OnEditing";
settings.ClientSideEvents.BatchEditRowInserting = "OnEditing";
settings.ClientSideEvents.BatchEditStartEditing = "OnEditing";
}).Bind(Model).GetHtml()