Setting the cssclass property of a CalenderDay properly

12 posts, 0 answers
  1. Melvin Lee
    Melvin Lee avatar
    7 posts
    Member since:
    Oct 2007

    Posted 20 Nov 2007 Link to this post

    I try to initialize a RadCalendar with special days (holidays, weekends) programmatically. The following code snippet shows how I do it

    RadCalendarDay day = new RadCalendarDay(RadCalendar1);
    day.Date = DateTime.Today;
    day.IsSelectable = false;
    day.ItemStyle.CssClass = "outOfRange_Default";
    RadCalendar1.SpecialDays.Add(day);

    However the rendered HTML is not what I expected. The cell has the following class

    <td class="radCalDefault_Default outOfRange_Default">

    instead of the following what I would have expected

    <td class="outOfRange_Default">

    How can I achieve this?

    Another question, that is related, how do I tell RadCalendar that weekend days are out of range?
  2. Petja
    Admin
    Petja avatar
    631 posts

    Posted 21 Nov 2007 Link to this post

    Hello Marvin Lee,

    By default the all calendar style classes are rendered and when there is a css class set to some of its components, both classes are rendered (class="radCalDefault_Default outOfRange_Default") as the settings from the second one overwrite the settings from the first. There is no option so you could render only the class you have set as most of the people just set some color settings and expect to have the same style appearance which come from the first class. This is the reason we render both of them. Let us know what kind or problem you achieve with the both applied css classes and we will advice you further how to proceed.
    Concerning making the weekend days out of range days, this is not possible. You could only set MinDate and MaxDate as a valid range, but can not set days in the range to be out of range. We suggest you to set the days to be unselectable and change its css class so they look like the out of range days, which could be achieved by adding the weedend days as SpecialDays as set its property IsSelectable="false" and change its CssClass to be the same as the out of range days.
    Let us know if you have further problems.

    Sincerely yours,
    Petja
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Melvin Lee
    Melvin Lee avatar
    7 posts
    Member since:
    Oct 2007

    Posted 22 Nov 2007 Link to this post

    Hi,
    This is exactly what I'm trying to do with the code snippet that I have added. I tried to give the special days that I have provided the same look & feel as days that are out of range.
    This is what I have done. The page where I have added the Calendar control has the EnableTheming property set to true and the theme property set to default. I have set the RangeMinDate and RangeMaxDate properties. Special days that fall between this range should behave like they are out of range. This means they are grey and the mouse pointer should stay an arrow.
    However I cannot achieve this by setting the cssclass of the special day or by setting properties like IsSelectable.
  4. Petja
    Admin
    Petja avatar
    631 posts

    Posted 22 Nov 2007 Link to this post

    Hi Marvin,

    Excuse us for this inconvenience. It seems to be an issue concerned with the  css class order which our developers already fixed. Find attached an unofficial hotfix of RadCalendar which addresses the issue. Your Telerik points are updated.
    We hope that helps.

    Greetings,
    Petja
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Melvin Lee
    Melvin Lee avatar
    7 posts
    Member since:
    Oct 2007

    Posted 23 Nov 2007 Link to this post

    Hi Petja,

    I wonder if you have not put up the wrong patch since I'm trying the Prometheus version of the Calendar control.

  6. Petja
    Admin
    Petja avatar
    631 posts

    Posted 26 Nov 2007 Link to this post

    Hello Marvin,

    Excuse us for the misunderstanding. Find attached an unofficial Prometheus suit hotfix.
    Let us know if you have further questions.

    Regards,
    Petja
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Melvin Lee
    Melvin Lee avatar
    7 posts
    Member since:
    Oct 2007

    Posted 27 Nov 2007 Link to this post

    Hi Petja,
    I have tried the patch and according to me it works partially.  The cell is grayed out and I cannot select the special day but when I hover over the cell, the hand cursor is displayed instead of the arrow cursor.
    Maybe I have to set another property?
  8. Petja
    Admin
    Petja avatar
    631 posts

    Posted 27 Nov 2007 Link to this post

    Hello Marvin Lee,

    It will be best if you could send us your project with some description what is not working, so we could observe the problem locally and advice you further.

    All the best,
    Petja
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Melvin Lee
    Melvin Lee avatar
    7 posts
    Member since:
    Oct 2007

    Posted 27 Nov 2007 Link to this post

    Hi Petja,

    How can I send you my test project? I cannot add it to this post as attachment.
     
    There is nothing special that I do. What I want is that if I mark that a day is not selectable, I want it to behave like a day that is out of range. To me this means it is grayed out, it is not selectable and if I hover over the cell, the mouse cursor should not change. It should stay the arrow cursor. I cannot make a printscreen of it since the cursor is not shown in the image 
  10. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 27 Nov 2007 Link to this post

    Hello Marvin,

    You can attach the demo application to a formal support ticket started from your Client.net account. We will test it locally and will get around to you with our findings.

    Kind regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. Mark
    Mark avatar
    52 posts
    Member since:
    Sep 2007

    Posted 08 Dec 2007 Link to this post

    This problem seems to affect me as well.  I set special date background color, but it doesn't appear in the calendar 'until' I hover over the cell, then the background color changes to what I expect and remains until I select something or move to another month.
  12. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 10 Dec 2007 Link to this post

    Hi Mark,

    As suggested previously, attach the demo application to a formal support ticket started from your Client.net account. We will test it locally and will get around to you with our findings.

    Regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top