ASPxClientPivotGrid.PopupMenuItemClick Event
Occurs when a custom menu item has been clicked.
Declaration
PopupMenuItemClick: ASPxClientEvent<ASPxClientPivotMenuItemClickEventHandler<ASPxClientPivotGrid>>
Event Data
The PopupMenuItemClick event's data class is ASPxClientPivotMenuItemClickEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Area | Gets the field’s area. |
FieldID | Gets the field’s unique identifier. |
FieldValueIndex | Gets the index of the field value for which the popup menu has been invoked. |
MenuItemName | Gets the name of the menu item currently being clicked. |
MenuType | Gets the context menu’s type. |
Remarks
Handle the PopupMenuItemClick event to define an action for a custom menu item. The clicked menu item is identified by its name via the ASPxClientPivotMenuItemClickEventArgs.MenuItemName property. The popup menu’s type is returned by the ASPxClientPivotMenuItemClickEventArgs.MenuType property.
To obtain the field value for which the popup menu has been invoked, do the following:
- send a callback to the server by calling the ASPxClientPivotGrid.PerformCallback method. Pass the field identifier (ASPxClientPivotMenuItemClickEventArgs.FieldID) and field value index (ASPxClientPivotMenuItemClickEventArgs.FieldValueIndex) as a string of arguments.
- handle the server-side ASPxPivotGrid.CustomCallback event, parse the passed information and obtain the required field value via the ASPxPivotGrid.GetFieldValueByIndex method.
To create custom menu items, handle the ASPxPivotGrid.PopupMenuCreated event. To hide default menu items, handle the ASPxPivotGrid.AddPopupMenuItem event.