Key code:
/// <Summary> /// provide Tooltip for the node /// Description: // 1. set tree. toolTipController attributes // 2. use in the GetActiveObjectInfo event of ToolTipController // 3. example // tlLHData. customNodeTooltip (e, node => // {// string _ cabId = node. getKeyID (); // CCabInfo _ cabinfo = LHDBHelper. getCabInfo (_ cabId); // if (_ cabinfo! = Null) // {// return string. format ("check time: {0} \ r \ n online condition: {1} \ r \ n last active time: {2} \ r \ n ", /// _ cabinfo. chkDataTime, // _ cabinfo. ctuOnlineStatus = 1? "Online": "Not online", // _ cabinfo. lastAliveTime); //} // return string. empty ;///}); /// </summary> /// <param name = "tree"> TreeList </param> /// <param name = "e"> ToolTipControllerGetActiveObjectInfoEventArgs </param>/ // <param name = "builderNodeTooltipHandler"> DeleGate </param> public static void CustomNodeTooltip (this TreeList tree, toolTipControllerGetActiveObjectInfoEventArgs e, Func <TreeListNode, string> bu IlderNodeTooltipHandler) {if (e. selectedControl is DevExpress. xtraTreeList. treeList) {TreeList _ tree = (TreeList) e. selectedControl; TreeListHitInfo _ hit = _ tree. calcHitInfo (e. controlMousePosition); if (_ hit. hitInfoType = HitInfoType. cell) {TreeListViewInfo _ viewInfo = _ tree. viewInfo; RowInfo _ rowInfo = _ viewInfo. getRowInfoByPoint (e. controlMousePosition); CellInfo _ cellInfo = _ rowInfo. cells [_ hi T. column. visibleIndex] as CellInfo; EditHitInfo _ editHitInfo = _ cellInfo. editorViewInfo. calcHitInfo (e. controlMousePosition); if (_ editHitInfo. hitTest = EditHitTest. maskBox) {string _ toolTip = builderNodeTooltipHandler (_ hit. node); if (! String. IsNullOrEmpty (_ toolTip) e. Info = new ToolTipControlInfo (_ cellInfo, _ toolTip );}}}}
Code effect:
. Csharpcode ,. csharpcode pre {font-size: small; color: black; font-family: Las LAS, "Courier New", courier, monospace; background-color: # ffffff; /* white-space: pre ;*/}. csharpcode pre {margin: 0em ;}. csharpcode. rem {color: #008000 ;}. csharpcode. kwrd {color: # 0000ff ;}. csharpcode. str {color: #006080 ;}. csharpcode. op {color: # effecc0 ;}. csharpcode. preproc {color: # cc6633 ;}. csharpcode. asp {background-color: # ffff00 ;}. csharpcode. html {color: #800000 ;}. csharpcode. attr {color: # ff0000 ;}. csharpcode. alt {background-color: # f4f4f4; width: 100%; margin: 0em ;}. csharpcode. lnum {color: #606060 ;}