Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Treeview question

Treeview question

Scheduled Pinned Locked Moved Visual Basic
questioncsharphelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KreativeKai
    wrote on last edited by
    #1

    I have a treeview in my form. When you click on one of the nodes (node 1 for this example) the _AfterSelect event executes code based on which node was selected. I pull up another record and once the record has loaded I click on the treeview again (node 1) to have code executed for the new record. I’m having problems where the treeview still retains node 1 that was selected for the first record so the _AfterSelect event is not triggered. I’ve tried to use treeview.refresh and several other methods to try and refresh the treeview to not have any nodes selected when starting a new record. Unfortunately nothing I try works. I’ve put in a workaround to select a node (node 4) that is not used normally to allow the user to click node 1 without having to worry about it not working because the previous record selected node 1. Has anyone ran into this problem and do you have a workaround? :confused:

    Lost in the vast sea of .NET

    K S 2 Replies Last reply
    0
    • K KreativeKai

      I have a treeview in my form. When you click on one of the nodes (node 1 for this example) the _AfterSelect event executes code based on which node was selected. I pull up another record and once the record has loaded I click on the treeview again (node 1) to have code executed for the new record. I’m having problems where the treeview still retains node 1 that was selected for the first record so the _AfterSelect event is not triggered. I’ve tried to use treeview.refresh and several other methods to try and refresh the treeview to not have any nodes selected when starting a new record. Unfortunately nothing I try works. I’ve put in a workaround to select a node (node 4) that is not used normally to allow the user to click node 1 without having to worry about it not working because the previous record selected node 1. Has anyone ran into this problem and do you have a workaround? :confused:

      Lost in the vast sea of .NET

      K Offline
      K Offline
      KreativeKai
      wrote on last edited by
      #2

      I found the solution from a suggestion on another forum and wanted to post it in case anyone else might be searching for help on this issue: TreeView.SelectedNode = Nothing It works great!! :-D

      Lost in the vast sea of .NET

      1 Reply Last reply
      0
      • K KreativeKai

        I have a treeview in my form. When you click on one of the nodes (node 1 for this example) the _AfterSelect event executes code based on which node was selected. I pull up another record and once the record has loaded I click on the treeview again (node 1) to have code executed for the new record. I’m having problems where the treeview still retains node 1 that was selected for the first record so the _AfterSelect event is not triggered. I’ve tried to use treeview.refresh and several other methods to try and refresh the treeview to not have any nodes selected when starting a new record. Unfortunately nothing I try works. I’ve put in a workaround to select a node (node 4) that is not used normally to allow the user to click node 1 without having to worry about it not working because the previous record selected node 1. Has anyone ran into this problem and do you have a workaround? :confused:

        Lost in the vast sea of .NET

        S Offline
        S Offline
        salysle
        wrote on last edited by
        #3

        Manuall set the treeview selected node to nothing when you want to clear all of the selections, e.g., TreeView1.SelectedNode=Nothing.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups