简体   繁体   中英

Default right-click context menu in WPF GridView

I'm currently working on a project that uses the WPF GridView. I've been charged with altering the right-click context menu.

Currently the right-click context menu brings up a menu with a checklist of the columns in it. Is this default behaviour? I'm unable to find any such context menu in the code. I need to somehow persist these column selections so they survive a restart of the application.

I hope someone can help. I've not been able to find any information on this menu anywhere!

Mark

这不是默认行为,必须进行编码。

Not only is there no default context menu built into a WPF GridView , but I don't think that you can even attach one at all. The GridView may be hosted in a ListView control and that could have its own context menu.

If you can find the XAML file that contains the GridView , then look or search for the keyword ContextMenu . This is the name of the property which gets context menus attached.

Alternatively, search through the whole solution for any bits of text that is displayed either in the context menu, or maybe even in the GridView headers.

The best advice that I can give is to get a good book and start learning WPF.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM