Treeview question
-
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
-
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
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
-
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