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

RadComboBox client event onload

2 Answers 116 Views
This is a migrated thread and some comments may be shown as answers.
Nicklas Johansson
Top achievements
Rank 1
Nicklas Johansson asked on 03 Oct 2008, 02:11 PM
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 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 03 Oct 2008, 02:18 PM
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.
0
Om
Top achievements
Rank 1
answered on 23 Oct 2010, 10:55 AM
Thanks Rosi,
This has solved my prolonged issue.

With Regards
Om Shanker Mishra
Asked by
Nicklas Johansson
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Om
Top achievements
Rank 1
Share this question
or