How to easily create popup menu for DevExpress treelist z
http://www.itjungles.com/how-to-easily-create-popup-menu-for-devexpress-treelist.html
Adding popup menu to DevExpress treelist is an easy task. Follow these simple steps to accomplish this:
1. Once you have the project setup and you have added the treelist to your Windows form. Go to the Toolbox and added in BarManager and Popup Menu. It is located under the section DX.9.3: Navigation & Layout.

2. Now below for your form designer there will be two items. Click on the ResultMenu property and assign the barManager1 to the Manager property.
>>>>>>> 
3. Now you will need to add some code to the CloseUp event for the popup menu. Double click on the CloseUp event so that it will automatically generate the event handler in the code behind file.

private void ResultMenu_CloseUp(object sender, EventArgs e)
{
if (NeedRestoreFocused)
tlFuncLoc.FocusedNode = SavedFocused;
}
4. Now you need to write some code to the treelist MouseUp event.
On the treelist properties windows double click on the MouseUp event.
private void tlFuncLoc_MouseUp(object sender, MouseEventArgs e)
{
TreeList tree = sender as TreeList;
if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && tree.State == TreeListState.Regular)
{
Point pt = tree.PointToClient(MousePosition);
TreeListHitInfo info = tree.CalcHitInfo(pt);
if (info.HitInfoType == HitInfoType.Cell)
{
SavedFocused = tree.FocusedNode;
int SavedTopIndex = tree.TopVisibleNodeIndex;
tree.FocusedNode = info.Node;
NeedRestoreFocused = true;
ResultMenu.ShowPopup(MousePosition);
}
}
}
5. Add the two below variable to the top of the class.
TreeListNode SavedFocused;
bool NeedRestoreFocused;
6. Now click on Customize on the Popup menu to start adding the menu item. Double click on the menu item to create the event handler for that menu item.


Addtional examples:
http://www.devexpress.com/Support/Center/KB/p/A915.aspxhttp://www.devexpress.com/Help/?document=XtraBars/CustomDocument5472.htm&levelup=true
How to easily create popup menu for DevExpress treelist z的更多相关文章
- create Context Menu in Windows Forms application using C# z
In this article let us see how to create Context Menu in Windows Forms application using C# Introduc ...
- Anaconda Error opening file for writing , failed to create anacoda menu等报错问题解决方案
安装anaconda的时候可能会遇到这个报错, 原因可能是:路径不允许有空格 此外发生报错failed to create anacoda menu, 解决方案 进入 cmd,找到你安装的位置(我的是 ...
- windows安装anaconda 报错failed to create anacoda menu ?
windows安装anaconda 报错failed to create anacoda menu ? 装了无数次,每次都是 failed to create anacoda menu然后无选择忽略, ...
- Android -- Options Menu,Context Menu,Popup Menu
Options Menu 创建选项菜单的步骤: 1. ...
- popup menu案例,无说明只代码
效果图: 布局文件, 展示列表的容器 <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...
- Devexpress TreeList控件绑定显示父子节点对像
今天一位同事咨询Devexpress TreeList控件绑定自动显示父子节点对像,但结果是不会显示带父子节点关系,而是将所有的节点作为父节点显示出来了,对像类的代码如下 public class I ...
- 如何让DevExpress TreeList的每个结点高亮显示?
概述:如何让DevExpress TreeList的每个节点高亮显示? 如何让DXperience TreeList的每个节点高亮显示? 效果如下: private void treeList1_Cu ...
- DevExpress TreeList使用教程之绑定多级树
DevExpress TreeList使用教程之绑定多级树 概述:TreeList控件可以同时显示树结构和其他数据列,即在一个列上建立父子关系展开或收缩,同时还可以显示其他列的内容.在TreeLi ...
- Android学习总结——Popup menu:弹出式菜单
PopupMenu,弹出菜单,一个模态形式展示的弹出风格的菜单,绑在在某个View上,一般出现在被绑定的View的下方(如果下方有空间). 注意:弹出菜单是在API 11和更高版本上才有效的. 核心步 ...
随机推荐
- HDU 3038 How Many Answers Are Wrong(带权并查集)
太坑人了啊,读入数据a,b,s的时候,我刚开始s用的%lld,给我WA. 实在找不到错误啊,后来不知怎么地突然有个想法,改成%I64d,竟然AC了 思路:我建立一个sum数组,设i的父亲为fa,sum ...
- [STL]单词转换
如果单词转换文件的内容是: 'em themcuz becausegratz grateful i Inah nopos ...
- grunt安装失败处理
1.官网 Grunt官网 http://gruntjs.com 2.前言 前段时间一不小心升级了win10(万恶的360),各种不适应各种问题各种软件bug,最终决定回退到win7,然后悲催的发现系统 ...
- POJ 3440 Coin Toss(求概率)
题目链接 题意 :把硬币往棋盘上扔,分别求出硬币占1,2,3,4个格子的时候的概率. 思路 : 求出公式输出,不过要注意输出格式,我还因为输入的时候用了int类型错了好几次..... #include ...
- lintcode:Valid Sudoku 判断数独是否合法
题目: 判断数独是否合法 请判定一个数独是否有效.该数独可能只填充了部分数字,其中缺少的数字用 . 表示. 样例 下列就是一个合法数独的样例. 注意 一个合法的数独(仅部分填充)并不一定是可解的.我们 ...
- 在mybatis执行SQL语句之前进行拦击处理
转载自:http://blog.csdn.net/hfmbook/article/details/41985853 比较适用于在分页时候进行拦截.对分页的SQL语句通过封装处理,处理成不同的分页sql ...
- GitHub最全的前端资源汇总仓库(包括前端学习、开发资源、求职面试等)
在GitHub上收集的最全的前端资源汇总(包括前端学习.前端开发资源.前端求职面试等) 个人结合github上各位大神分享的资源进行了简单的汇总整理,每一个条目下面都有丰富的资料,是前端学习.工作的好 ...
- HDFS小文件处理——Mapper处理
处理小文件的时候,可以通过org.apache.hadoop.io.SequenceFile.Writer类将所有文件写出到一个seq文件中. 大致流程如下: 实现代码: package study. ...
- Windows 7下配置JDK环境变量和Java环境变量配置
下面来介绍一下Java环境变量配置,是在Windows 7下配置JDK环境变量. 方法/步骤 1 安装JDK,安装过程中可以自定义安装目录等信息,例如我们选择安装目录为:C:\Program Fil ...
- apns-http2-php,苹果push升级到http2
最近公司push推送升级,用苹果http2进行推送,http2的好处就不说了,这些网上都可以查到,但是真正在项目中用的,用php写的还是特别少,因此,写出来跟大家分享,废话不说了,直接上代码: pus ...