I'm working on a software to display some Database structure. I'm using SMO to retrieve Information about tables, Vies an Procedures. The Object Structure is as follows:
- Database - Tables - Views - Procedures
I retrieve some database objects, which contain Collections of Views, Tables and Procedures.
What I want to do know is populate a TreeView with the different Collections. The first Level of TreviewItems would be dynamic and display the Databases. In the second level (under the databases) would be three static Items. These would be named "Tables", "Views" and "Procedures". Each of these subitems should be populated by one of the Collections in the database object. I've tried the following code:
This code works nearly as expected but has the problem that you can't select any items. It seems like the problem occurs due to the TreeViewItems that I'm adding to the TreeView. In another thread I've read, that you should just add TextBoxes (or other controls) since the TreeView automatically surrounds them with a TreeViewItem. But How can I add Subitems to these TextBox-"Items"?
Thanks in advance :-)