How to show an invalid SelectedDate?

5 posts, 0 answers
  1. Curtis Mathews
    Curtis Mathews avatar
    4 posts
    Member since:
    Feb 2007

    Posted 28 Jul 2008 Link to this post

    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!
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Jul 2008 Link to this post

    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.
  3. Vasssek
    Vasssek avatar
    185 posts
    Member since:
    Aug 2010

    Posted 04 Oct 2011 Link to this post

    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
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Oct 2011 Link to this post

    Hello Vasssek,

    You can achieve the desired behavior by setting the property SkipMinMaxDateValidationOnServer which is available only for the latest version.
     
    Thanks,
    Shinu.
  5. Vasssek
    Vasssek avatar
    185 posts
    Member since:
    Aug 2010

    Posted 04 Oct 2011 Link to this post

    Hello Shinu,

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

    Thank you (7p).

    Vasssek

Back to Top