Telerik RadDatePicker set ClientEvents-OnDateSelected from javascript/jquery

472 Views Asked by At

I use a combination of different controls in an ASP.Net Repeater. Included are now already 2 RadComboBoxes. I add the SelectedIndexChanged to them in this way:

for (var i = 0; i < aClientIds.length; i++) {
     var comboBox = $find(aClientIds[i]);
     var id = comboBox.get_id();
     comboBox.add_selectedIndexChanged(ddlList_SelectedIndexChanged);
}

The list of ClientIds are saved to a hidden field from Codebehind and retrieved to a JavaScript array in the js.file associated with the usercontrol where the Repeater is shown. Works nicely. I also must include a RadDatePicker and attach ClientEvents-OnDateSelected in the same way. Already have this working and get the correct id:

for (var i = 0; i < aDateClientIds.length; i++) {
     var calendar = $find(aDateClientIds[i]);
     var id = calendar.get_id();
     alert('id:' + id);
}

But how do I attach ClientEvents-OnDateSelected from JavaScript? I can't find this in the Telerik documentation or on Google

1

There are 1 best solutions below

0
On

You cant do it with attached event , you should use some hidden field or bool var in javascript for you solution.

As i saw on telerik forum: adding-ondateselected-event-method-dynamically-for-raddatepicker