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

binding OnDateSelected clientside

3 Answers 52 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Kazim
Top achievements
Rank 1
Kazim asked on 24 Nov 2011, 03:11 PM
Hi,
Is there anyway to bind OnDateSelected  event on clientside

i tried the following code on the javascript but not able to bind event
var dtp=$find('<%=dtp%>');
 
dtp.OnDateSelected = this.dtpFrom_DateSelected;

Is anyone knows how to fix this.

thanks.

kazim

3 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 24 Nov 2011, 06:02 PM
Hi Kazim,

Your scenario is supported by the controls. You should use the ClientEvents to subscribe to OnDateSelected event as it is shown below.
<telerik:RadCalendar ID="RadCalendar1" runat="server">
    <ClientEvents OnDateSelected="DateSelected" />
</telerik:RadCalendar>

The final step is to write the JavaScript function.
function DateSelected(sender, eventArgs) {
    //your code
}

Regards,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Kazim
Top achievements
Rank 1
answered on 24 Nov 2011, 06:04 PM
Hi Antonio ,

Thanks for your reply.

but i want to add this event at clientside using javascript. after page rendered to the client.

Thanks.

Kazim
0
Kevin
Top achievements
Rank 2
answered on 24 Nov 2011, 08:48 PM
Hello Kazim,

You're code would need to be changed to something like this:

function pageLoad() {
    var dtp=$find('<%=dtp%>'); 
    dtp.add_dateSelected(dtpFrom_DateSelected);
}

I hope that helps.
Tags
Calendar
Asked by
Kazim
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Kazim
Top achievements
Rank 1
Kevin
Top achievements
Rank 2
Share this question
or