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

Populate RadTextBox in Template from RadCombobox

2 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JSON
Top achievements
Rank 1
JSON asked on 23 Jul 2012, 07:32 PM
I am having an issue with the following. I have a general RadGrid with two specific Grid Template columns (RadComboBox/RadTextBox). The Combo box is formatted for Load on demand. When a value is found/selected from the combo box (OnIndexChanged) I want to populate the RadTextBox with the combo box DataValueField value.

I have access to the combo box in the onindexchanged event, but am not sure how to gain access to the RadTextBox in it's own template. Have tried a number of solutions over several days without success.

Thank you,

SteveO

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Jul 2012, 03:33 AM
Hi,

Please try the following code snippet to access the RadTextBox in the SelectedIndexChanged event of the RadComboBox

C#:
protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
    RadComboBox RadComboBox1= (RadComboBox)sender;
    GridEditableItem eitem = (GridEditableItem)RadComboBox1.NamingContainer;
    string ValueField = RadComboBox1.SelectedValue;
    RadTextBox TextBox = (RadTextBox)eitem.FindControl("tbLoginId");
    TextBox.Text = ValueField;
}

Thanks,
Shinu.
0
JSON
Top achievements
Rank 1
answered on 24 Jul 2012, 10:48 AM
Awesome, that is what I needed. Thank you for the quick response!

SteveO
Tags
Grid
Asked by
JSON
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
JSON
Top achievements
Rank 1
Share this question
or