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;
                }
    
    
            }
  • 相关阅读:
    window.history 和 DWZ 框架
    Ztree 随笔记
    eval的对于验证数学公式的用处
    lodop打印控件一点记录
    font和lineheight冲突。
    Windows CMD命令大全
    centos 下安装pip pip3
    Linux访问windows共享文件夹
    数据库主从和读写分离的配置和使用方法
    centos7 nginx+php7yum安装
  • 原文地址:https://www.cnblogs.com/jara/p/3363710.html
Copyright © 2011-2022 走看看