1

I have a treeview for show the contact details of customer.

I bring contact details into treeview but if i click any customer name it would show customers details in seperate textboxes like, firstname, lastname, personal email, office email,it will go upto 17 data's.

Please any one help how to solve this problem.

Here is example image what i want to exactly

example

1 Answer 1

3

You can use SelectedNode property of the treeview to get the text of the selected node.

textBox1.Text = treeView1.SelectedNode.Text;

To get the text of the child of the selected node, you can use

textBox1.Text = treeView1.SelectedNode.Nodes["NodeName"].Text;
Sign up to request clarification or add additional context in comments.

9 Comments

I think the OP is also looking for how to put the children's data in to their own textboxes as well.
@paqogomez Well that isn't what he said? but I added it to my answer. Just in case
@paqogomez thank u for your reply..but what i want is the selected value is only the datatables first data....i need to display all the column value to corresponding textboxes(near to 17 texboxes and 17 columns value in datatable) when i select tree view's node....
@DharaniRadhakrishnanR I really don't get what you want. You want to display the data in the all treeview's nodes once you select a node?
@DharaniRadhakrishnanR, Mr. Unicorn's answer does this. if you replace "NodeName" with "Address" and "phone" etc, and point that value at their respective text boxes it will work.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.