How check Selected Date not equal to special date?

2 posts, 0 answers
  1. Mk
    Mk avatar
    12 posts
    Member since:
    Aug 2012

    Posted 26 Oct 2012 Link to this post

    I am using RadCalendar with special days. how can i check selected Date not equals to special days in asp.net.

    Thanks.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Oct 2012 Link to this post

    Hi,

    Try the following code to achieve your scenario.

    C#:
    protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)
    {
     bool flag = true;
     foreach (RadCalendarDay day in RadCalendar1.SpecialDays)
     {
      if (day.Date.CompareTo(RadCalendar1.SelectedDate) == 0)
      {
       flag = false;
      }
     }
     if (flag)
     {
      Response.Write("Not Same");
     }
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top