Right-click the DevExpress gridView column title and choose "devexpressgridview ".
1. Add a PopupMenuShowing event
2. The code in the PopupMenuShowing event is as follows:
Private void gridView1_PopupMenuShowing (object sender, DevExpress. xtraGrid. views. grid. popupMenuShowingEventArgs e) {if (e. menuType = DevExpress. xtraGrid. views. grid. gridMenuType. column) // right-click the menu {GridViewColumnMenu menu = e. menu as GridViewColumnMenu; menu. items. removeAt (6); // remove the 7th functions from the right-click menu, starting from 0. // menu. items. clear () Clear all functions // Items. add (parameter, parameter, parameter) Add function }}
How to Use DevExpress to make a pop-up right-click menu?
With BarManager and PopupMenu, you can use the visual designer to add menu items and use popupMenu. Show () in appropriate places in the program to display them.
Set the order of the gridview Columns
Use Column to set columns when writing gv at the front end.
Assume that the column to be added is Label. In this case, capture the column Id in the background and operate on the column. When you run the operation, you will find that the foreground places the Label in the column, the column number appears.