如何设置devexpress grid 编辑TreeList中指定行指定列的编辑状态

> devexpress中的treelist怎么做到获取选中的多个行的值
devexpress中的treelist怎么做到获取选中的多个行的值
wanbei7921819 & &
发布时间: & &
浏览:37 & &
回复:1 & &
悬赏:0.0希赛币
devexpress中的treelist如何做到获取选中的多个行的值新人表示只会一次获取一个,选中多个的时候该怎么做呢?
各位给给思路吧~谢谢
设置:TreeListOptionsSelection.MultiSelect为true
通过&treeList1.Selection集合获取。jacky0303 & &
& & (0)(0)
本问题标题:
本问题地址:
温馨提示:本问题已经关闭,不能解答。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&二次元同好交流新大陆
扫码下载App
汇聚2000万达人的兴趣社区下载即送20张免费照片冲印
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(2757)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_083067',
blogTitle:'设置DevExpress.TreeList的单击事件',
blogAbstract:'private void tlCategory_MouseClick(object sender, MouseEventArgs e)&&&&&&& {&&&&&&&&&&& &&&&&&&&&&& TreeListHitInfo hitinfo = new TreeListHitInfo();&&&&&&&&&&& hitinfo = tlCategory.CalcHitInfo(e.Location);&&&&&&&&&&& &&&&&&&&&&& //if mouse not click the nodes,',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:7,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}DevExpress的gridcontrol里面,如何设置指定行的某列的背景色?
[问题点数:50分,结帖人sgyiliya]
DevExpress的gridcontrol里面,如何设置指定行的某列的背景色?
[问题点数:50分,结帖人sgyiliya]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
2012年 总版技术专家分年内排行榜第一
2013年 总版技术专家分年内排行榜第七2011年 总版技术专家分年内排行榜第五2009年 总版技术专家分年内排行榜第九
本帖子已过去太久远了,不再提供回复功能。DevExpress之TreeList用法实例总结
投稿:shichen2014
字体:[ ] 类型:转载 时间:
这篇文章主要介绍了DevExpress之TreeList用法,对于C#初学者有一定的借鉴价值,需要的朋友可以参考下
本文实例总结了DevExpress之TreeList用法,希望对大家学习C#程序设计起到一定的帮助作用。具体实例如下:
using System.Collections.G
using System.D
using System.Windows.F
using DevExpress.XtraB
using DevExpress.XtraTreeL
using DevExpress.XtraTreeList.N
namespace DevExpressUtilHelpV3
public static class TreeListToolV3
public delegate string BuildPathRule(string nodeText, string fullPathInfo);
/// &summary&
/// 获取选中节点到根节点的所有信息
/// &/summary&
/// &param name="focusedNode"&TreeListNode&/param&
/// &param name="columnID"&列名称&/param&
/// &param name="buildPathRule"&规则委托&/param&
/// &returns&路径信息&/returns&
public static string FullPathInfo(this TreeListNode focusedNode, string columnID, BuildPathRule buildPathRule)
if (focusedNode == null)
throw new ArgumentNullException("focusedNode");
if (string.IsNullOrEmpty("columnID"))
throw new ArgumentNullException("columnID");
string _fullPathInfo = string.E
_fullPathInfo = focusedNode.GetDisplayText(columnID);
while (focusedNode.ParentNode != null)
focusedNode = focusedNode.ParentN
string _nodeText = focusedNode.GetDisplayText(columnID).Trim();
_fullPathInfo = buildPathRule(_nodeText, _fullPathInfo);
return _fullPathI
public delegate bool CompareNodeRule(TreeListNode focusedNode);
/// &summary&
/// 获取筛选节点到根节点的所有信息
/// &/summary&
/// &param name="focusedNode"&TreeListNode&/param&
/// &param name="columnID"&列名称&/param&
/// &param name="compareNodeRule"&规则委托&/param&
/// &param name="buildPathRule"&规则委托&/param&
/// &returns&路径信息&/returns&
public static string FilterPathInfo(this TreeListNode focusedNode, string columnID, CompareNodeRule compareNodeRule, BuildPathRule buildPathRule)
if (focusedNode == null)
throw new ArgumentNullException("focusedNode");
if (string.IsNullOrEmpty("columnID"))
throw new ArgumentNullException("columnID");
string _fullPathInfo = string.E
_fullPathInfo = focusedNode.GetDisplayText(columnID);
while (focusedNode.ParentNode != null)
focusedNode = focusedNode.ParentN
if (compareNodeRule(focusedNode))
string _nodeText = focusedNode.GetDisplayText(columnID).Trim();
_fullPathInfo = buildPathRule(_nodeText, _fullPathInfo);
return _fullPathI
/// &summary&
/// 递归遍历树节点
/// &/summary&
/// &param name="tree"&&/param&
/// &param name="opreateRule"&&/param&
public static void LoopTree(this TreeList tree, Action&TreeListNode& opreateRule)
if (tree == null)
throw new ArgumentNullException("tree");
foreach (TreeListNode node in tree.Nodes)
opreateRule(node);
if (node.Nodes.Count & 0)
LoopTreeNodes(node, opreateRule);
/// &summary&
/// 递归遍历TreeListNode节点
/// &/summary&
/// &param name="node"&&/param&
/// &param name="opreateRule"&&/param&
public static void LoopTreeNodes(this TreeListNode node, Action&TreeListNode& opreateRule)
if (node == null)
throw new ArgumentNullException("node");
foreach (TreeListNode _childNode in node.Nodes)
opreateRule(_childNode);
LoopTreeNodes(_childNode, opreateRule);
/// &summary&
/// 递归遍历TreeListNode,当opreateRule返回false停止循环
/// &/summary&
/// &param name="node"&TreeListNode&/param&
/// &param name="opreateRule"&Func&TreeListNode, bool&&/param&
public static void LoopTreeNodes_Break(this TreeListNode node, Func&TreeListNode, bool& opreateRule)
if (node == null)
throw new ArgumentNullException("node");
foreach (TreeListNode _childNode in node.Nodes)
if (!opreateRule(_childNode))
LoopTreeNodes_Break(_childNode, opreateRule);
/// &summary&
/// 递归遍历TreeListNode,当opreateRule返回false跳出循环,直接进入下次循环
/// &/summary&
/// &param name="node"&TreeListNode&/param&
/// &param name="opreateRule"&Func&TreeListNode, bool&&/param&
public static void LoopTreeNodes_Continue(this TreeListNode node, Func&TreeListNode, bool& opreateRule)
if (node == null)
throw new ArgumentNullException("node");
foreach (TreeListNode _childNode in node.Nodes)
if (!opreateRule(_childNode))
LoopTreeNodes_Continue(_childNode, opreateRule);
public delegate bool CheckNodeRule(TreeListNode fucusedNode);
public delegate void CheckNodeNullRule();
/// &summary&
/// 节点为null检查
/// &/summary&
/// &param name="fucusedNode"&TreeListNode&/param&
/// &param name="checkNodeRule"&若为NULL,处理逻辑&/param&
/// &returns&TreeListNode&/returns&
public static TreeListNode CheckNull(this TreeListNode fucusedNode, CheckNodeNullRule checkNodeRule)
if (fucusedNode == null)
checkNodeRule();
return fucusedN
/// &summary&
/// 正对节点的检查逻辑
/// &/summary&
/// &param name="fucusedNode"&TreeListNode&/param&
/// &param name="checkNodeRule"&检查逻辑代码[委托]&/param&
/// &returns&TreeListNode&/returns&
public static TreeListNode Check(this TreeListNode fucusedNode, CheckNodeRule checkNodeRule)
if (fucusedNode != null)
return checkNodeRule(fucusedNode) == true ? fucusedNode :
/// &summary&
/// 水平滚动条
/// &/summary&
/// &param name="tree"&TreeList&/param&
public static void HorzScroll(this TreeList tree)
if (tree == null)
throw new ArgumentNullException("tree");
tree.OptionsView.AutoWidth =
tree.BestFitColumns();
tree.HorzScrollVisibility = ScrollVisibility.A
/// &summary&
/// 为TreeList附加右键菜单
/// MouseUp(object sender, MouseEventArgs e)事件中调用
/// &/summary&
/// &param name="tree"&TreeList&/param&
/// &param name="e"&MouseEventArgs&/param&
/// &param name="menu"&PopupMenu&/param&
/// &param name="attachMenuRule"&AttachMenuRule&/param&
public static void AttachMenu(this TreeList tree, MouseEventArgs e, PopupMenu menu, Func&TreeListNode, bool& attachMenuRule)
if (tree == null)
throw new ArgumentNullException("tree");
if (menu == null)
throw new ArgumentNullException("menu");
if (e.Button == MouseButtons.Right && Control.ModifierKeys == Keys.None && tree.State == TreeListState.Regular)
Point _point = new Point(Cursor.Position.X, Cursor.Position.Y);
TreeListHitInfo _hitInfo = tree.CalcHitInfo(e.Location);
if (_hitInfo.HitInfoType == HitInfoType.Cell)
tree.SetFocusedNode(_hitInfo.Node);
if (attachMenuRule(tree.FocusedNode))
menu.ShowPopup(_point);
/// &summary&
/// 设置父节点的状态AfterCheckNode(object sender, NodeEventArgs e)
/// &/summary&
/// &param name="node"&&/param&
/// &param name="check"&&/param&
public static void ProcessNodeCheckState(this TreeListNode node, CheckState check)
if (node == null)
throw new ArgumentNullException("node");
SetCheckedChildNodes(node, check);
SetCheckedParentNodes(node, check);
/// &summary&
/// 设置子节点CheckState
/// &/summary&
/// &param name="node"&&/param&
/// &param name="check"&&/param&
private static void SetCheckedChildNodes(TreeListNode node, CheckState check)
if (node != null)
node.LoopTreeNodes((TreeListNode _node) =&
_node.CheckState =
/// &summary&
/// 设置父节点CheckState
/// &/summary&
/// &param name="node"&&/param&
/// &param name="check"&&/param&
private static void SetCheckedParentNodes(TreeListNode node, CheckState check)
if (node.ParentNode != null)
bool _checkStatus =
CheckState _nodeS
node.LoopTreeNodes_Break((TreeListNode _node) =&
_nodeState = _node.CheckS
if (!check.Equals(_nodeState))
_checkStatus = !_checkS
//跳出循环
//继续循环
node.ParentNode.CheckState = _checkStatus ? CheckState.Indeterminate :
SetCheckedParentNodes(node.ParentNode, check);
/// &summary&
/// 根据CheckState获取TreeListNode
/// &/summary&
/// &param name="tree"&TreeList&/param&
/// &param name="state"&CheckState&/param&
/// &param name="GetNodesByStateRule"&返回True的时候继续&/param&
/// &returns&TreeListNode集合&/returns&
public static List&TreeListNode& GetNodesByState(this TreeList tree, CheckState state, Func&TreeListNode, bool& GetNodesByStateRule)
if (tree == null)
throw new ArgumentNullException("tree");
List&TreeListNode& _checkNodes = new List&TreeListNode&();
tree.LoopTree((TreeListNode node) =&
if (GetNodesByStateRule(node))
if (node.CheckState == state)
_checkNodes.Add(node);
return _checkN
本文实例备有详尽的注释,可以帮助大家更好的加以理解。
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具

我要回帖

更多关于 devexpress grid 编辑 的文章

 

随机推荐