Focus not working for Textbox for Radwindow

4 posts, 0 answers
  1. prejesh vp
    prejesh vp avatar
    2 posts
    Member since:
    Sep 2009

    Posted 08 Sep 2009 Link to this post

    Hi,
    I have an texbox inside radwindow , I am not able to focus the textbox using code inside radwindow, however i am able to do the same in silverlight usercontrol. Below is the code used.Please do the needful.

    HtmlPage.Plugin.Focus();

    theTextBox.Focus();

  2. Humayon
    Humayon  avatar
    12 posts
    Member since:
    Oct 2006

    Posted 09 Sep 2009 Link to this post

    try
          public userControl1()
            {
                InitializeComponent();
                Loaded+=new RoutedEventHandler(userControl_loaded);
         }
    void userControl_loaded(object sender, RoutedEventArgs e)
    {
      ThetextBox.focus();
    }
  3. DevCraft banner
  4. prejesh vp
    prejesh vp avatar
    2 posts
    Member since:
    Sep 2009

    Posted 09 Sep 2009 Link to this post

    Still not working.please help.
  5. Humayon
    Humayon  avatar
    12 posts
    Member since:
    Oct 2006

    Posted 09 Sep 2009 Link to this post

    try again
          public userControl1()
            {
                InitializeComponent();
                Loaded+=new RoutedEventHandler(userControl_loaded);
         }
    void userControl_loaded(object sender, RoutedEventArgs e)
    {
     new System.Threading.Thread(() =>
             {
                this.Dispatcher.BeginInvoke(() =>
                {
                     ThetextBox.focus();
                });
             }).Start();    




    }
Back to Top