如何自定义TreeList单元格的工具条
作者:mayz 来源:DevExpress 浏览:Loading...次 发布时间:2013-02-16 评论:0条
问题解答:
自定义TreeList单元格的工具条,请参考以下代码:
sing System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.ViewInfo;
namespace CustomTooltip 
{
    public partial class Form1 : Form 
{
        public Form1() 
{
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e) 
{
            new DevExpress.XtraTreeList.Design.XViews(treeList1);
        }
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
            if(e.SelectedControl is DevExpress.XtraTreeList.TreeList)
{
                TreeList tree = (TreeList)e.SelectedControl;
                TreeListHitInfo hit = tree.CalcHitInfo(e.ControlMousePosition);
                if(hit.HitInfoType == HitInfoType.Cell) 
{
                    object cellInfo = new TreeListCellToolTipInfo(hit.Node, hit.Column, null);
                    string toolTip = string.Format("{0} (Column: {1}, Node ID: {2})", hit.Node[hit.Column], hit.Column.FieldName, hit.Node.Id);
                    e.Info =  new DevExpress.Utils.ToolTipControlInfo(cellInfo, toolTip);                    
                }
            }
        }
    }
}
本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [http://www.devexpresscn.com/]
本文地址:http://www.devexpresscn.com/Resources/FAQ-367.html
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [http://www.devexpresscn.com/]
本文地址:http://www.devexpresscn.com/Resources/FAQ-367.html
关键字: XtraTreelist
评论列表
暂无评论
请谈谈你的看法 请使用IE或者Firefox浏览器,暂不支持Chrome!

慧都控件网为DevExpress界面控件的中国地区唯一正式授权经销商,正版控件销售公司,授权代理商,经销商及合作伙伴。
电话:400-700-1020
              023-66090381
邮箱:sales@evget.com
相关资源
- DXGrid单元格样式
 - 更改数据单元格的呈现效果
 - 如何将EXCEL模板导入到自定义的报表控件中
 - 定义DXGrid的打印外观
 - 创建自定义约会编辑表单
 - ASPxTreeList控件FAQ
 - ASPxTreeList创建自定义命令按钮
 - 放大DXGrid单元格中的图像
 - 如何修改DXGrid for WPF单元格的背景色?
 - DXCharts图表控件来自定义图表标题
 - 如何调用自定义约会表单中的ASPxPopupControl控件?
 - DevExpress XtraGrid网格控件示例四:初始化新建行的单元格
 - DevExpress XtraGrid网格控件示例六:自定义合并单元格
 - 如何格式化XtraGrid网格控件中的单元格
 - DevExpress XtraGrid网格控件示例:在GridView中编辑合并后的单元格
 - 如何创建一个支持垂直导航的自定义GridControl?
 - ASPxGridView控件常用示例三:创建自定义过滤项
 - ASPxGridView控件常用示例六:创建自定义的命令按钮
 - XtraGrid动态自定义控制按钮的显示
 - 禁用ASPxTreeList复选框选项
 
 
    


