Selecting a TreeView node programmatically?
-
Hi all On my Windows application form I have a TreeView on the left and a number of textboxes on the right. The Treeview shows a list of users and the textboxes are for editing or adding new users. When I click on a user in the TreeView, the textbox fields are populated with the selected user's details. After I click the save button the TreeView is being reloaded to reflect the changed details of the user. How can I select that specific node in the TreeView programmatically so that it still shows that user as being selected? Help on this or any suggestions on a better method would be appreciated. Thank you. kobus
-
Hi all On my Windows application form I have a TreeView on the left and a number of textboxes on the right. The Treeview shows a list of users and the textboxes are for editing or adding new users. When I click on a user in the TreeView, the textbox fields are populated with the selected user's details. After I click the save button the TreeView is being reloaded to reflect the changed details of the user. How can I select that specific node in the TreeView programmatically so that it still shows that user as being selected? Help on this or any suggestions on a better method would be appreciated. Thank you. kobus
-
Hi all On my Windows application form I have a TreeView on the left and a number of textboxes on the right. The Treeview shows a list of users and the textboxes are for editing or adding new users. When I click on a user in the TreeView, the textbox fields are populated with the selected user's details. After I click the save button the TreeView is being reloaded to reflect the changed details of the user. How can I select that specific node in the TreeView programmatically so that it still shows that user as being selected? Help on this or any suggestions on a better method would be appreciated. Thank you. kobus
You could save
treeView.SelectedNode
before reloading the tree and then set it back after reloading is done. Regards Senthil _____________________________ My Blog | My Articles | WinMacro