Results 1 to 6 of 6

Thread: Treeview

  1. #1
    Calvin James is offline VB.NET Forum Newbie
    .NET Framework
    Join Date
    Sep 2005
    Posts
    3
    Reputation
    0

    Question Treeview

    I'm new to treeviews. I can see that they could be really useful.
    I've got some code that will allow me to choose from one field in my table using a combo box and then the formview automatically shows the whole record from that table.
    Can anyone show me how to do the same with a treeview? ie a treeview to replace the combo box please.

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is online now VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    11,345
    Reputation
    1543
    It is pointless using a TreeView unless your data has a tree-like structure. If you are only going to go one level deep then you should just use a ListBox or ListView.

  3. #3
    Calvin James is offline VB.NET Forum Newbie
    .NET Framework
    Join Date
    Sep 2005
    Posts
    3
    Reputation
    0
    Thanks for your reply.

    Sorry, I should have explained that eventually I will want to select from a node at a lower level but for now I just wanted a pointer in the direction so a simple one level tree would demonstrate the principle.

    I have been using treeviews in MSAccess for some time and developed quite complex solutions. I can now see that I might be able to transfer this complexity to the web page.

  4. #4
    jmcilhinney's Avatar
    jmcilhinney is online now VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    11,345
    Reputation
    1543
    Sorry for that then. Are you developing a Winforms app or a WebForms app? The TreeView is a WinForms control, so you can't use it on a web page. If it is a WinForms app, I'd suggest you just look at the help topic entitled "TreeView Control (Windows Forms)", which provides links to pretty much all the information you'd need.

  5. #5
    Calvin James is offline VB.NET Forum Newbie
    .NET Framework
    Join Date
    Sep 2005
    Posts
    3
    Reputation
    0

    Question

    Thanks again for the reply.

    You can use Treeview in a webform. I have some trivial examples working already!

  6. #6
    jmcilhinney's Avatar
    jmcilhinney is online now VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    11,345
    Reputation
    1543
    Well that's interesting. I've never done any Web development but I was under the impression that Windows Forms controls were limited to Windows Forms apps, or is there a Web-specific TreeView class that I'm not aware of?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking