I'm dynamically creating a RadDatePicker in the VB .NET code behind like so...
Dim
oCalCell
As
New
HtmlTableCell()
Dim
oRadPicker
As
New
Telerik.WebControls.RadDatePicker()
oRadPicker.ID =
"cldrStageDate"
oRadPicker.Calendar.ID = "
cldrStageDate_calendar"
oRadPicker.Calendar.ClientEvents.OnLoad =
"cldrLoaded"
oCalCell.Controls.Add(oRadPicker)
Then on the client side I have the following javascript code:
function
cldrLoaded(oCtl) {
var
sCtlId =
null
;
if
(
typeof
(oCtl.get_id) ===
"function"
) sCtlId = oCtl.get_id().split(
'_calendar'
)[0];
else
sCtlId = oCtl.ClientID;
var
oCldr = $find(sCtlId);
}
The control is rendered on the page and appears to be working. But inside "cldrLoaded", oCtl doesn't have a function named "get_id" when this function is called, but it does have a "ClientID" set. But the $find(sCtlID) won't find the RadDatePicker.
I have a DatePicker declared in the .aspx page that works as expected:
<telerik:RadDatePicker id=
"cldrStageDate"
runat=
"server"
>
<Calendar ID=
"cldrStageDate_calendar"
runat=
"server"
>
<ClientEvents OnLoad=
"cldrLoaded"
/>
</Calendar>
</telerik:RadDatePicker>
How can I get the proper object get sent to the OnLoad function?
Thanks!