binding OnDateSelected clientside

4 posts, 0 answers
  1. Kazim
    Kazim avatar
    2 posts
    Member since:
    Nov 2011

    Posted 24 Nov 2011 Link to this post

    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
  2. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 24 Nov 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kazim
    Kazim avatar
    2 posts
    Member since:
    Nov 2011

    Posted 24 Nov 2011 Link to this post

    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
  5. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 24 Nov 2011 Link to this post

    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.
Back to Top