Right-click the DevExpress gridView column title and choose "devexpressgridview ".

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.