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

How to show an invalid SelectedDate?

4 Answers 89 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Curtis Mathews
Top achievements
Rank 1
Curtis Mathews asked on 28 Jul 2008, 07:19 PM
Hi,

When editing something that a user has previously scheduled.   I need to be able to show the date they had previously selected, even though it may be before the current minimum date.  I want to be able to show the selected date, but not allow them to select it if it is before the minimum date.

If you try to set the SelectedDate property before the minimum date, an error is thrown.

Anyone know of a good way to do this?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Jul 2008, 01:05 PM
Hi Curtis,


Try the following JavaScript code and see whether it is working.

JS:
function OnDateSelecting(calendarInstance, args)  
{  
     var dt = new Date();  
     var dt=(dt.getFullYear()+","+ (dt.getMonth()+1) +","+ dt.getDate()  
      if((args.RenderDay.Date) < dt)  
      {    
      return false;  
      }  
 


Thanks
Princy.
0
Vasssek
Top achievements
Rank 1
answered on 04 Oct 2011, 09:22 AM
Hello,

I have similar problem. In editform I fill RadDatePicker selected date from SQL database. But when min date condition is set to e.g. rdp1.MinDate = DateTme.Now(); and date taken from database is older, then an error appeared.

My question is, how to insert older date than Today and show invalidate triangle in RadDatePicker. Is it posible to do it from server side (C#) or ?

Thank you

vasssek
0
Shinu
Top achievements
Rank 2
answered on 04 Oct 2011, 10:49 AM
Hello Vasssek,

You can achieve the desired behavior by setting the property SkipMinMaxDateValidationOnServer which is available only for the latest version.
 
Thanks,
Shinu.
0
Vasssek
Top achievements
Rank 1
answered on 04 Oct 2011, 11:21 AM
Hello Shinu,

It's exactly what I was looking for :))

Thank you (7p).

Vasssek

Tags
Calendar
Asked by
Curtis Mathews
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Vasssek
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or