Back to Devexpress

How to: Display a Context Menu For Column Headers

aspnet-3781-components-grid-view-examples-how-to-display-a-context-menu-for-column-headers.md

latest634 B
Original Source

How to: Display a Context Menu For Column Headers

  • Sep 30, 2021

The example below handles the ASPxClientGridView.ContextMenu event to display a context menu when a user right-clicks within the column header panel.

The image below shows the result.

javascript
<ClientSideEvents ContextMenu="function(s, e) {
            if(e.objectType == 'header') 
                headerMenu.ShowAtPos(ASPxClientUtils.GetEventX(e.htmlEvent), ASPxClientUtils.GetEventY(e.htmlEvent));
}" />