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

3 posts, 0 answers
  1. Jayashree
    Jayashree avatar
    14 posts
    Member since:
    Dec 2008

    Posted 10 Jul 2009 Link to this post

    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. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Jul 2009 Link to this post

    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.
  3. Jayashree
    Jayashree avatar
    14 posts
    Member since:
    Dec 2008

    Posted 10 Jul 2009 Link to this post

    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
Back to Top