zoukankan      html  css  js  c++  java
  • 鼠标指向表格时 显示更多信息 toolTipController1

    //窗体添加 控件 ,然后将GridControl 相关属性栏对应上新加的控件 切记  本文是转帖,稍作修改    
    private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
            {
                this.gridControl1.ToolTipController = tip;
                if (e.SelectedControl != gridControl1) return;
    
                ToolTipControlInfo info = null;
    
                GridView view = gridControl1.GetViewAt(e.ControlMousePosition) as GridView;
                if (view == null) return;
    
    
                GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
    
                //if (hi.HitTest == GridHitTest.RowIndicator)// 我测试时要注掉这行才搞定
                //{ 
                //An object that uniquely identifies a row indicator cell
                object o = hi.HitTest.ToString() + hi.RowHandle.ToString();
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("行数据基本信息:");
                foreach (GridColumn gridCol in view.Columns)
                {
                    if (!gridCol.Visible)//如果加 ! 表示 被隐藏的列,如果不加,则显示所见的列
                    {
                        sb.AppendFormat("{0}:{1}
    ", gridCol.Caption, view.GetRowCellDisplayText
    
    (hi.RowHandle, gridCol.FieldName));
                    }
                }
                info = new ToolTipControlInfo(o, sb.ToString());
    
                // }
    
                //Supply tooltip information if applicable, otherwise preserve default tooltip (if any)
                if (info != null)
                {
                    e.Info = info;
                }
    
    
            }
  • 相关阅读:
    mysql插入中文数据变成问号怎么处理
    项目第二阶段
    项目第一阶段
    项目测试
    常用mysql操作
    常用的mysql操作
    mysql操作
    土地档案管理系统需求分析
    土地档案管理系统架构图,ER图,用例图
    Load data local infile
  • 原文地址:https://www.cnblogs.com/jara/p/3363710.html
Copyright © 2011-2022 走看看