RadCalendar alternate styles of .rcMain .rcRow a, .RadCalendar_Silk .rcMain .rcRow span

4 posts, 0 answers
  1. Marco
    Marco avatar
    2 posts
    Member since:
    Jul 2013

    Posted 12 Sep 2014 Link to this post

    Hello, I have a problem that is as follows, I am using a calendar but I want it to appear in different configurations depending on an earlier choice. For example if the option is one I want to show the calendar with the days of the week black and weekends ash if the option is 2 I want the weekends are the black and the gray days of the week.

    For the 1st option happens altered :

     .RadCalendar_Silk .rcMain .rcWeekend a {
                        color:#C2BABA;
                    }

    but then I can not change to black when the 2nd option is chosen.

    Anyone have any idea how to do this?

    Thanks You
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 17 Sep 2014 Link to this post

    Hello Marco,

    Note that changing the Calendar styles dynamically could lead to various issues depending on your specific configuration. Therefore I would suggest you as a better option in your case, to use several calendars on the page with initially defined styles and simply manipulate their visibility based on the chosen option.

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marco
    Marco avatar
    2 posts
    Member since:
    Jul 2013

    Posted 17 Sep 2014 in reply to Maria Ilieva Link to this post

    Ok, thanks.

    I have another problem

              if (isHoliday)    
                          {
                              calendarDay.IsSelectable = false;
                              calendarDay.ToolTip = eventString;
                              calendarDay.TemplateID = "Silk";
                              calendarDay.ItemStyle.CssClass = "Holiday";
                          }
                          else
                          {
                             calendarDay.IsSelectable = true;
                             calendarDay.ToolTip = eventString;
                             calendarDay.TemplateID = "Silk"; 
                             calendarDay.ItemStyle.CssClass = "Holiday";
                          }

    when the code enter in else the "calendarDay.IsSelectable = true" not working and if i remove the "calendarDay.TemplateID = "Silk";" it works but the cell not use template = Silk. Why  "calendarDay.IsSelectable = true" not working?

    In the case of 

        if (isHoliday)    
                          {
                              calendarDay.IsSelectable = false;
                              calendarDay.ToolTip = eventString;
                              calendarDay.TemplateID = "Silk";
                              calendarDay.ItemStyle.CssClass = "Holiday";
                          }

    works fine.

    Thanks
  5. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 22 Sep 2014 Link to this post

    Hello Marco,

    Note that IsSelected actually does not select the date and only apply the css class of the date. In order to select the date you could use the following approach.
    else
    {
       calendarDay.IsSelectable = true;
       calendarDay.ToolTip = eventString;
       calendarDay.TemplateID = "Silk";
       calendarDay.ItemStyle.CssClass = "Holiday";
       RadCalendar1.SelectedDate = calendarDay.Date;
    }

    Regards,
    Kostadin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top