RadComboBox client event onload

3 posts, 0 answers
  1. Nicklas Johansson
    Nicklas Johansson avatar
    7 posts
    Member since:
    Sep 2008

    Posted 03 Oct 2008 Link to this post

    Hi!

    If I want to change the selected item on a RadComboBox at onload (on the client), how can I do that? The real problem is I think is finding a suitable event to call $find in. If I call $find in document.onload it just restuns null.

    I have been looking for something similar to the ClientEvents on the RadTextBox but I can't find any thing like it for the RadComboBox.

  2. Rosi
    Admin
    Rosi avatar
    2529 posts

    Posted 03 Oct 2008 Link to this post

    Hi Nicklas Johansson,

    ASP.NET Ajax controls are not immediately initialized. As a result $find will not return valid object unless called after all client-side object have been initialized. You can use the pageLoad function where $find is guaranteed to return valid object:

    function pageLoad()
    {
         var combo = $find("<%= RadComboBox1.ClientID %>");
        alert(combo.get_text());
    }

    For more info about the pageLoad function and the client-side life-cycle in ASP.NET Ajax you can check the following article: http://www.asp.net/AJAX/Documentation/Live/overview/AJAXClientEvents.aspx

    Also you can use OnClientLoad event of RadComboBox to complete your task.

    Regards,
    Rosi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Om
    Om avatar
    3 posts
    Member since:
    Oct 2010

    Posted 23 Oct 2010 Link to this post

    Thanks Rosi,
    This has solved my prolonged issue.

    With Regards
    Om Shanker Mishra
Back to Top