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

How to set focus of a RadTextbox on change or RadCombo box

2 Answers 134 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jayashree
Top achievements
Rank 1
Jayashree asked on 10 Jul 2009, 11:07 AM
Hi,

        I just want to set the focus of a RadTextbox, on change of RadCombobox. I've a  master page in which all the Pages are inherited. Can any one help me in this please.

Thanks,
Jayashree.S

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Jul 2009, 11:59 AM
Hi,

I am not sure where the RadComboBox and RadTextBox are placed in your master - content page respectively. Checkout the code to access controls from masterpage/content page and set focus to textbox.

C#:
 
protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
{  
    //to find control in content page  
    RadTextBox text = (RadTextBox)this.ContentPlaceHolder1.FindControl("RadTextBox1");  
 
    // To find control in master page  
    //RadTextBox text = (RadTextBox)this.Master.FindControl("RadTextBox1");  
    text.Focus();   

Thanks,
Princy.
0
Jayashree
Top achievements
Rank 1
answered on 10 Jul 2009, 12:30 PM
Hi,

    My Radtextbox and Razdcombo box is not in my master page they are in seperate page in which the master page is inherited.
I have tried on selectedindex change (txtbox1.focus()) but the focus is not coming.

Thanks,
Jayashree.S
Tags
Input
Asked by
Jayashree
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jayashree
Top achievements
Rank 1
Share this question
or