给TreeList的根和子节点弹出不同的右键菜单
作者: 火车头 日期: 2006-07-10 01:42
好象没几个人用dev的treelist,好早就想实现这个效果,经过一个多小时的摸索,终于找到了实现方法
定义两个不同的popup contentMenu
在mouse_down事件中处理
定义两个不同的popup contentMenu
在mouse_down事件中处理
下载: contentmenu.cs
- private void JobTree_MouseDown(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Right)
- {
- DevExpress.XtraTreeList.TreeListHitInfo hInfo = this.JobTree.CalcHitInfo(new Point(e.X, e.Y));
- if (hInfo.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell) //在单元格上右击了
- {
- if(hInfo.Node.RootNode.Id==hInfo.Node.Id) //说明是根节点 站点
- this.barManager1.SetPopupContextMenu(this.JobTree, this.popupSite);
- else //任务
- this.barManager1.SetPopupContextMenu(this.JobTree, this.popupJob);
- }
- }
- }
评论: 0 |
引用: 0 |
阅读: 2373
发表评论
订阅
上一篇 |
返回
下一篇
标签: