In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to display items in different collections as children of the same parent node in WPF interface development? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
System background
Platform: WPF
Product: DXTreeList for WPF
Framework: .NET Framework Build 20.1.4
Operating system: Windows 10 x64
IDE:Microsoft Visual Studio 2019
Problems encountered
When using the TreeListView implementation solution to display structured data, use IChildNodesSelector to build the tree. When working properly, there is a model, and each level can have multiple SubType,ClassA with members List ClassB and List ClassC. It is found that all the examples mention only one possible subtype, and as for the display, all classes implement an interface that maps to the corresponding properties of the class.
Public interface ITreeBaseItem {string ObjectType {get;} string Element {get;} string Title {get;} string Detail1 {get;} string Detail2 {get;} string Detail3 {get;}}
The excerpt is from here.
Public class CustomChildrenSelector: IChildNodesSelector {public IEnumerable SelectChildren (object item) {if (item is ProjectStage) return ((ProjectStage) item) .tasks; else if (item is ProjectObject) return ((ProjectObject) item) .stages; return null;}}
The question is: what if the ProjectStage class not only has a task, but also has another subtype, the target? Can you do this using IChildNodesSelector, or should you continue with other policies?
Solution:
Technically, you can merge these collections into a selector and return the results. You can refer to the method demonstrated below: How to: Implement Hierarchical Data Binding via Child Nodes Selector. You must also disable editing of different types of missing attributes, using CellTemplateSelector to implement this method.
The answer to the question about how to display items in different collections as the same parent item in WPF interface development is shared here. I hope the above content can be of some help to everyone. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.