Skip to content

DevExpress-Examples/winforms-treelist-customize-cell-tooltip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms TreeList - Customize cell tooltips (hints)

This example shows how to handle the ToolTipController.GetActiveObjectInfo event to customize the tooltips displayed for TreeList cells:

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);                    
        }
    }
}

Files to Review

Documentation

See Also

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)