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

[Solved] Need clarification on Combo box

1 Answer 82 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Vijayaragavan
Top achievements
Rank 1
Vijayaragavan asked on 12 Oct 2009, 12:35 PM
Hi,

      Am using Rad Combo box as as a user control. In my main page am using the user control combo box as one column and the next column is a text box which is read only.

    Values for combo are populated from DB on Load on demand in RadAjaxCombo_ItemsRequested method.

    My need is when i populate a value to combo box, the corresponding value from DB has to be populated to read only text box, which is available near by the Combo box.

    Can you please give me an example to avoid this problem.

Thanks & Regards,
Vijay R

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Oct 2009, 09:36 AM
Hi Vijayaragavan,

Try the following code snippet in order to set the TextBox text according to RadComboBox selected item text.

C#:
 
protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) 
    Page p = (Page)this.NamingContainer; 
    TextBox txtBox = (TextBox)p.FindControl("TextBox1"); 
    txtBox.Text = (o as RadComboBox).SelectedItem.Text; 

-Shinu.
Tags
ComboBox
Asked by
Vijayaragavan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or