Special Days and Skins

3 posts, 0 answers
  1. Michael Stone
    Michael Stone avatar
    25 posts
    Member since:
    Sep 2006

    Posted 27 Apr 2008 Link to this post

    I built a calendar where I create a link button as a day's contents using a class derived from ITemplate.

    This works fine.

    Some of the days in the current month have events in them so I highlight these by setting the background image like this:

    LinkButton link = new LinkButton();
    link.ID = day.Date.ToString("MM/dd/yyyy");
    link.Text = day.Date.Day.ToString();
    link.ToolTip = day.ToolTip;
    // Is there an event on this day?
    if (bEvent)
    {
        link.Style.Add("background", "url(" + SkinImagePath + "HoverBg.gif) left top no-repeat");
    }
    // Build the command parameters for this link.
    link.Command += new CommandEventHandler(onDayClick);
    link.CommandName = "ShowDay";
    link.CommandArgument = day.Date.ToShortDateString();
    CalendarCellContentTemplate template = new CalendarCellContentTemplate(calendar, day.Date, link);

    I believe I got the method from another posting is this forum.  The problem is with the highlighted line.  It works fine with a skin such as Web20 but it looks wrong with other skins.  I looked in the skin CSS files and saw why.  For Web20 the background image is as big as a cell and so is not repeated.  With other skins the background image is very narrow and repeated on X.  Some other skins don't even have a "HoverBG.gif".

    I want to allow my users to be able to select whichever skin they like so I want to know if there's a higher-level way of doing this?  Is there some property I can set?

    Note, I also use the method described in this forum to disable hover so only the event days have this appearence:

    Literal js = new Literal();
    js.ID = "JavaScriptLiteral";
    js.Text = "<script type=\"text/javascript\">\nwindow.onload = function()\n{\nRadCalendarNamespace.RenderDay.prototype.ApplyHoverBehavior = function(){return false;};\n}\n</script>\n";
    Controls.Add(js);

    Thank you.

  2. Michael Stone
    Michael Stone avatar
    25 posts
    Member since:
    Sep 2006

    Posted 27 Apr 2008 Link to this post

    Sorry, I just noticed this is in the wrong forum.

    I'm not using the new asp.net ajax release yet.
  3. Plamen Peshev
    Admin
    Plamen Peshev avatar
    885 posts

    Posted 30 Apr 2008 Link to this post

    Hi Michael,


    You can modify directly the predefined skin you chose for the RadCalendar control - you can read the following link from the RadCalendar help regarding skins (if haven't already done that):

    http://www.telerik.com/help/aspnet/calendar/?cldSkins.html

    I hope this helps


    Regards,
    Plamen
    the Telerik team

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