DevExpress實現(xiàn)TreeList按條件隱藏節(jié)點CheckBox的方法
更新時間:2014年08月06日 16:42:22 投稿:shichen2014
這篇文章主要介紹了DevExpress實現(xiàn)TreeList按條件隱藏節(jié)點CheckBox的方法,需要的朋友可以參考下
本文實例講述了DevExpress實現(xiàn)TreeList按條件隱藏節(jié)點CheckBox的方法,在項目開發(fā)中有一定的使用價值。具體的實現(xiàn)方法如下:
主要功能代碼如下:
/// <summary> /// 隱藏CheckBox /// 說明 /// 在CustomDrawNodeCheckBox事件中使用 /// eg: /// TreeList _curTree = (TreeList)sender; /// _curTree.HideCheckBox(n => n.GetNodeType() == NodeType.Area || n.GetNodeType() == NodeType.CabsGroupRoot, e); /// </summary> /// <param name="tree">TreeList</param> /// <param name="conditionHanlder">委托</param> /// <param name="e">CustomDrawNodeCheckBoxEventArgs</param> public static void HideCheckBox(this TreeListNode tree, Predicate<TreeListNode> conditionHanlder, CustomDrawNodeCheckBoxEventArgs e) { if (conditionHanlder(e.Node)) { e.Handled = true; } }
代碼使用方法如下:
void LHTree_CustomDrawNodeCheckBox(object sender, CustomDrawNodeCheckBoxEventArgs e) { TreeList _curTree = (TreeList)sender; _curTree.HideCheckBox(n => n.GetNodeType() == NodeType.Area || n.GetNodeType() == NodeType.CabsGroupRoot, e); }
代碼運行效果如下:
相關(guān)文章
Extjs4如何處理后臺json數(shù)據(jù)中日期和時間
本文給大家分享Extjs4如何處理后臺json數(shù)據(jù)中日期和時間,通過代碼示例給大家剖析,感興趣的朋友快來圍觀2015-08-08將excel數(shù)據(jù)轉(zhuǎn)換成dataset示例
這篇文章主要介紹了不借助第三方插件的情況下將Excel中的數(shù)據(jù)轉(zhuǎn)換成DataSet的方法,需要的朋友可以參考下2014-02-02