-
Notifications
You must be signed in to change notification settings - Fork 1
/
Client-side.aspx.cs
20 lines (19 loc) · 957 Bytes
/
Client-side.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using DevExpress.Web;
using System.Collections.Generic;
using System.Web.UI;
public partial class ClientSide : Page {
protected void Grid_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) {
if (e.MenuType == GridViewContextMenuType.Rows) {
e.Items.Clear();
e.Items.Add(e.CreateItem("Custom item for all rows", "AllRows"));
e.Items.Add(e.CreateItem("Custom item for selected rows only", "OnlySelectedRows"));
e.Items.Add(e.CreateItem("Custom item for selected rows with 'Discontinued=true' only", "OnlySelectedAndDiscontinuedRows"));
}
}
protected void Grid_CustomJSProperties(object sender, ASPxGridViewClientJSPropertiesEventArgs e) {
List<bool> list = new List<bool>();
for (int i = 0; i < Grid.VisibleRowCount; i++)
list.Add((bool)Grid.GetRowValues(i, "Discontinued"));
e.Properties["cpDiscontinued"] = list;
}
}