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

Feature Date Validation For RadDatePicker

1 Answer 49 Views
Input
This is a migrated thread and some comments may be shown as answers.
Kaushal
Top achievements
Rank 1
Kaushal asked on 01 Nov 2011, 10:47 AM
Hello ALL,

I have used RadDatePicker into my web page, Now i want to restrict feature date selection to user.

So i had set the max date property as today's date from code behind.it's working properly, user can't able to select feature date from calender.

In case if user try to add feature date manually, then date picker highlighted with warning symbol with yellow color.

But when i click on save button and checked Page.IsValid property, it will always give me true and i got the date picker selected value as null.

How can i validate RadDatePicker for feature date? Please help me.

Here is my code :

aspx :
  <telerik:RadDatePicker ID="dpCompletedDate" Calendar-ShowRowHeaders="false"
                                    Skin="Office2007" runat="server"  />

Page Load cs :
dpCompletedDate.MaxDate = System.DateTime.Now;

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 01 Nov 2011, 01:33 PM
Hello Kaushal,

The RadDatePicker validation doesn't use any validators to prevent a postback from happening. You need to use a CompareValidator, to prevent a postback from happening by comparing it to the MaxDate you used in your RadDatePicker.

I hope that helps.
Tags
Input
Asked by
Kaushal
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or