Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concept Question... 2

Status
Not open for further replies.

sqlsamurai

Programmer
May 11, 2005
120
US
My boss found this piece of code and liked the concept of it. He wants to design an interface that has a treeview on the left and a panel on the right. When you click on one of the treeview nodes it loads a user control into the panel.

I've examined the code and understand how it works but we're new to the .NET world I'm not sure if there is a better way.

If its not too much trouble I'd like someone to take a quick peek at it and give me their opinion. If this is an inappropriate request then I apologize.

Here is the link for the code. Its in Visual Studio 2005.

Thanks
 
Thanks alphanytz for your input.

However I was really referring to the use of the two arrays, is this really the best way to load user controls into the panel?

 
I actually have a system almost identical to that.

The tree view with the navigation system is populated from a database that resolves security for the user. The right side is just a panel. In between the treeview and panel is a splitter control.

When the user clicks on an item from the treeview, the control related to that item is instantiated and the panel on the right is set equal to that newly created panel.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Well, in terms of scalability, I'd say go to ThatRickGuy's suggestion. Basically, the array is a datasource so you can dynamically populate the items of the treeview control. Quite convenient at first, but you're forced to hard-code everything (then compile). The problem starts when you decide to add more items (then recompile). The next day your boss decides to make localized versions ... you get the point. :)

Save the treeview items in an external file, say a database or a resource file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top