如何访问DevExpress XtraTreeList中绑定到节点的对象?
我创建了一个绑定到 BindingSource 的 XtraTreeList 控件,它使用自定义对象列表。 MultiSelect 属性设置为 true,因此当用户选择多个节点时,我想定义哪些对象绑定到它们。但不幸的是,我没有找到与所包含数据相关的任何属性(除了已过时且始终为空的数据)。我还尝试使用 TreeListNode.GetValue,但它只给我一个显示值,而不是对象本身
有没有办法访问绑定到 XtraTreeList 中节点的对象?
最后的手段是使用 Unbound 模式并手动创建它们,但我想知道是否有一个简单的解决方案
I have created an XtraTreeList control that is bound to my bindingSource and it uses a list of custom objects. The MultiSelect property is set to true, so when the user selects multiple nodes I want to define what objects are bound to them. But unfortunately I haven't found any property related to contained data (except the Data which is obsolete and is always null). I also tried to use TreeListNode.GetValue, but it only gives me a displayed value and not the object itself
Is there a way to get access to the object bound to node in XtraTreeList?
The last resort is to use Unbound mode and to create them manually, but I would like to know if there is a simple solution for that
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,请使用 TreeList.GetDataRecordByNode 方法。
Use the TreeList.GetDataRecordByNode method for this purpose.