This is a migrated thread and some comments may be shown as answers.

Select value Dynamically in a combo box with treeview control

2 Answers 56 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
A K
Top achievements
Rank 1
A K asked on 10 May 2010, 02:51 PM

When I am loading the page I want to select a value in Combobox with Treeview.

I am using following code, It selects correct value from a tree view but combo box doesn’t show this selected value, it always says “Select”.

How to I a show selected value on page load?

I am using following code.

      Dim tvCategory As RadTreeView = DirectCast(cboCategory.Items(0).FindControl("tvCategory"), RadTreeView)

                        tvCategory.FindNodeByValue(LCase(project.SubscriberCategory.Id.ToString)).Selected = True

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 May 2010, 07:29 AM

Hello,

Give a try with setting the Text proeprty explicitly when selecting the node in pageLoad event.

VB:

 
Dim tvCategory As RadTreeView = DirectCast(cboCategory.Items(0).FindControl("tvCategory"), RadTreeView)  
tvCategory.FindNodeByValue(Strings.LCase(project.SubscriberCategory.Id.ToString)).Selected = True  
 
cboCategory.Text = tvCategory.FindNodeByValue(Strings.LCase(project.SubscriberCategory.Id.ToString)).Text.ToString() 

-Shinu.

0
A K
Top achievements
Rank 1
answered on 11 May 2010, 12:55 PM
No it did not work.
Tags
ComboBox
Asked by
A K
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
A K
Top achievements
Rank 1
Share this question
or