Focus the Listbox

3 posts, 1 answers
  1. Robert
    Robert avatar
    198 posts
    Member since:
    Aug 2009

    Posted 02 Feb 2010 Link to this post

    How can I set focus on the listbox on page load.  I have plenty of methods and nothing seems to work.

    Is there something I am missing?
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Feb 2010 Link to this post

    Hello Robert,

    I am able to focus to the RadListBox using the following client side code. Add the pageLoad event to your page.

    JavaScript:
     
    <script type="text/javascript"
        function pageLoad() { 
            var listbox = $find("<%= RadListBox1.ClientID %>"); 
            listbox._getGroupElement().focus(); 
        } 
    </script> 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Robert
    Robert avatar
    198 posts
    Member since:
    Aug 2009

    Posted 03 Feb 2010 Link to this post

    Excellent Shinu.

    Thank you.
Back to Top