How to stop the Calendar after clicking button if it doesn't match the condition

2 posts, 0 answers
  1. Blind
    Blind avatar
    1 posts
    Member since:
    May 2011

    Posted 04 May 2011 Link to this post

    We use the RadDatePicker in our project. When the user click the RadDatePicker button to select the date, we will check if the condition is not matched, we need to cancel the action. And I have tried several ways, but they don't work.

    function dateSelected(datepickerInstance, args) {
                    args.CancelOpen = true;
                    return false;

    <telerik:RadDatePicker runat="server" ID="rdp1">
        <DateInput ID="DateInput2" CausesValidation="True" runat="server"></DateInput>
        <Calendar ID="Calendar2" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"   ViewSelectorText="x" runat="server"></Calendar>
        <DatePopupButton HoverImageUrl="" ImageUrl=""/>
        <ClientEvents OnPopupOpening="dateSelected" />

    Please help me.

    Thanks a lot!


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 May 2011 Link to this post

    Hello Blind,

    You can achieve this in OnPopupOpening client-side event handler.

    <script type="text/javascript">
      function dateSelected(datepickerInstance, args)

    Also check the following documentation.

Back to Top