zoukankan      html  css  js  c++  java
  • DevExpress中GridView上的右键菜单

    image

    如上图,先选中GridView,不是GridControl,在属性窗口中,选择事件窗口,注册事件MouseUp
    代码如下,其中popupMenu_ResumeGrid为DevExpress.XtraBars.PopupMenu

    gridView_ResumeCollection为private DevExpress.XtraGrid.Views.Grid.GridView

    ----------------------------------------------------------------

    private void gridView_ResumeCollection_MouseUp(object sender, MouseEventArgs e) {
                DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hi =this.gridView_ResumeCollection.CalcHitInfo(e.Location);
                if (hi.InRow && e.Button == MouseButtons.Right) {
                    popupMenu_ResumeGrid.ShowPopup(Control.MousePosition);
                }
            }

    ----------------------------------------------------------------

    备注序列化和反序列化代码

    IFormatter formatter = new BinaryFormatter();
                    using (Stream stream = new FileStream(ResumeCollection.ToString(), FileMode.Open, FileAccess.Read, FileShare.Read)) {
                        if (stream.Length > 0) {
                            formatter.Serialize(stream, new object());
                            //ResumeCollection = (ResumeCollection)formatter.Deserialize(stream);
                            stream.Close();
                        }
                    }

  • 相关阅读:
    扩展:13-SpringBoot-尚硅谷-基础入门
    Java-JDK动态代理(AOP)使用及实现原理分析
    程序员常用算法合集
    数据结构-图
    多叉树的基本概念
    平衡二叉树(AVL树)
    TP5返回多维数组
    使用HttpSession实现验证码
    thinkphp6使用
    无法链接远程数据库
  • 原文地址:https://www.cnblogs.com/xiaofengfeng/p/2179269.html
Copyright © 2011-2022 走看看