A tool i'm building has a TreeView Control (Telerik RadTreeView) which will show all element instances in a Project/Active/Selection. The problem is that even with UI Virtualization the window load times are far too long. I'm not sure what to suspect now and am hoping one of the community has ran across this.
Some examples of window load times below.
Here is some additional pertinent information .
Screenshot #1
Screenshot #2
Solved! Go to Solution.
A tool i'm building has a TreeView Control (Telerik RadTreeView) which will show all element instances in a Project/Active/Selection. The problem is that even with UI Virtualization the window load times are far too long. I'm not sure what to suspect now and am hoping one of the community has ran across this.
Some examples of window load times below.
Here is some additional pertinent information .
Screenshot #1
Screenshot #2
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Chris,
Thank you for your query.
I would suggest initially populating only the Tier 1, and then populating the other ones and their subnodes on demand when clicked by the user to open them.
If a specific node is never opened, there is no need to ever load its subnodes.
I am sure such techniques have already been implemented and published in the past.
In fact, I see a large number of solutions when searching the Internet for 'populate tree view on demand':
https://duckduckgo.com/?q=populate+tree+view+on+demand
I hope this helps.
Best regards,
Jeremy
Dear Chris,
Thank you for your query.
I would suggest initially populating only the Tier 1, and then populating the other ones and their subnodes on demand when clicked by the user to open them.
If a specific node is never opened, there is no need to ever load its subnodes.
I am sure such techniques have already been implemented and published in the past.
In fact, I see a large number of solutions when searching the Internet for 'populate tree view on demand':
https://duckduckgo.com/?q=populate+tree+view+on+demand
I hope this helps.
Best regards,
Jeremy
Jeremy, thank you for your suggestions and for continuing to help me and the community!
Much has happened since last Wednesday and i can report back that i now have a virtualized TreeView which will quickly handles projects with 200,000+ model elements!
I will gladly share this solution with any needing it so if you're interested please contact me.
Initially, my inexperience drove me to go the "safe" route towards populating the TreeView but on thursday i deleted most of what id done and fully embraced MVVM and working with Objects, in an object, in an object, in an object! Was a mind melter for me but it really paid off!
The method below is truly the meat of the solution and along with the XAML in the previously attached ZIP file make it work. Way shorter and simpler than i thought it would be.
private static void InitializeDataSource() { Tier1CategoryNames = new ObservableCollection<Tier1Object>(); Tier1Object tier1Object = null; Tier2Object tier2Object = null; Tier3Object tier3Object = null; Tier4Object tier4Object = null; foreach(var revitElementInstance in _revitElementInstances) { // ########## Tier 1 Start ########## var currentCategoryName = revitElementInstance.Category.Name; if(Tier1CategoryNames.Count == 0 || Tier1CategoryNames.All(tier1Object1 => tier1Object1.Tier1CategoryName != currentCategoryName)) { Tier1CategoryNames.Add(tier1Object = new Tier1Object(currentCategoryName)); } // ########## Tier 2 Start ########## var currentFamilyName = revitElementInstance.FamilyName; if(tier1Object.Tier2FamilyNames.Count == 0 || tier1Object.Tier2FamilyNames.All(tier2Object1 => tier2Object1.Tier2FamilyName != currentFamilyName)) { tier1Object.Tier2FamilyNames.Add(tier2Object = new Tier2Object(currentFamilyName)); } // ########## Tier 3 Start ########## var currentElementTypeName = revitElementInstance.ElementType.Name; if(tier2Object.Tier3ElementTypeNames.Count == 0 || tier2Object.Tier3ElementTypeNames.All(tier3Object1 => tier3Object1.Tier3ElementTypeName != currentElementTypeName)) { tier2Object.Tier3ElementTypeNames.Add(tier3Object = new Tier3Object(currentElementTypeName)); } // ########## Tier 4 Start ########## var currentElementInstanceName = revitElementInstance.ElementInstance.Name; tier3Object.Tier4ElementInstanceNames.Add(tier4Object = new Tier4Object(currentElementInstanceName)); } }
Jeremy, thank you for your suggestions and for continuing to help me and the community!
Much has happened since last Wednesday and i can report back that i now have a virtualized TreeView which will quickly handles projects with 200,000+ model elements!
I will gladly share this solution with any needing it so if you're interested please contact me.
Initially, my inexperience drove me to go the "safe" route towards populating the TreeView but on thursday i deleted most of what id done and fully embraced MVVM and working with Objects, in an object, in an object, in an object! Was a mind melter for me but it really paid off!
The method below is truly the meat of the solution and along with the XAML in the previously attached ZIP file make it work. Way shorter and simpler than i thought it would be.
private static void InitializeDataSource() { Tier1CategoryNames = new ObservableCollection<Tier1Object>(); Tier1Object tier1Object = null; Tier2Object tier2Object = null; Tier3Object tier3Object = null; Tier4Object tier4Object = null; foreach(var revitElementInstance in _revitElementInstances) { // ########## Tier 1 Start ########## var currentCategoryName = revitElementInstance.Category.Name; if(Tier1CategoryNames.Count == 0 || Tier1CategoryNames.All(tier1Object1 => tier1Object1.Tier1CategoryName != currentCategoryName)) { Tier1CategoryNames.Add(tier1Object = new Tier1Object(currentCategoryName)); } // ########## Tier 2 Start ########## var currentFamilyName = revitElementInstance.FamilyName; if(tier1Object.Tier2FamilyNames.Count == 0 || tier1Object.Tier2FamilyNames.All(tier2Object1 => tier2Object1.Tier2FamilyName != currentFamilyName)) { tier1Object.Tier2FamilyNames.Add(tier2Object = new Tier2Object(currentFamilyName)); } // ########## Tier 3 Start ########## var currentElementTypeName = revitElementInstance.ElementType.Name; if(tier2Object.Tier3ElementTypeNames.Count == 0 || tier2Object.Tier3ElementTypeNames.All(tier3Object1 => tier3Object1.Tier3ElementTypeName != currentElementTypeName)) { tier2Object.Tier3ElementTypeNames.Add(tier3Object = new Tier3Object(currentElementTypeName)); } // ########## Tier 4 Start ########## var currentElementInstanceName = revitElementInstance.ElementInstance.Name; tier3Object.Tier4ElementInstanceNames.Add(tier4Object = new Tier4Object(currentElementInstanceName)); } }
Congratulations on the brilliant result!
Sometimes it helps tremendously to start over, build on your existing experience, throw out the baggage...
Thank you for sharing the solution.
Cheers,
Jeremy
Congratulations on the brilliant result!
Sometimes it helps tremendously to start over, build on your existing experience, throw out the baggage...
Thank you for sharing the solution.
Cheers,
Jeremy
Edited and shared for posterity by The Building Coder:
https://thebuildingcoder.typepad.com/blog/2019/03/forum-fran%C3%A7ais-and-treeview-performance.html
Thank you again!
Cheers,
Jeremy
Edited and shared for posterity by The Building Coder:
https://thebuildingcoder.typepad.com/blog/2019/03/forum-fran%C3%A7ais-and-treeview-performance.html
Thank you again!
Cheers,
Jeremy
Thanks.!! it will help
Thanks.!! it will help
Can't find what you're looking for? Ask the community or share your knowledge.