Show Now + 2 Weeks

3 posts, 0 answers
  1. Shane Clay
    Shane Clay avatar
    29 posts
    Member since:
    May 2010

    Posted 30 May 2015 Link to this post

    Hi All

    Not sure this is possible, can't find any examples, so thought I'd ask.

    We want to create a calendar, preferably using the RadCalendar, that shows the first day of the current week + 14 days. Ie, rather than showing the entire current month, just show this week and next week.

    We'll then use the Day Render event to show relevant information in that cell for that day. 

    Has anyone seen something like this done with RadCalendar?


  2. Shane Clay
    Shane Clay avatar
    29 posts
    Member since:
    May 2010

    Posted 30 May 2015 in reply to Shane Clay Link to this post

    Using RangeMinDate and RangeMaxDate with ShowOtherMonthsDays="false" gets us part of the way there.

    Ideally though, we wouldn't see the rest of the days rendered at all, not even as blank cells. 

  3. Konstantin Dikov
    Konstantin Dikov avatar
    2124 posts

    Posted 03 Jun 2015 Link to this post

    Hi Shane,

    You can handle the server-side OnDayRender event of RadCalendar and set the Visible property of the cells that you want to hide to "false", but please note that this will break the structure of the calendar and the days will not be aligned correctly:
    protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
        if (e.Day.Date < RadCalendar1.RangeMinDate || e.Day.Date > RadCalendar1.RangeMaxDate)
            //e.Cell.Visible = false;          

    Now, if you need to hide the out of range cells, you can use the following CSS:
    <style type="text/css">
        .rcOutOfRange span{
            display: none!important;

    And here is the RadCalendar markup:
    <telerik:RadCalendar ID="RadCalendar1" runat="server" RangeMinDate="6/3/2015" RangeMaxDate="6/15/2015" ShowOtherMonthsDays="false" OnDayRender="RadCalendar1_DayRender"></telerik:RadCalendar>

    Hope this helps.

    Konstantin Dikov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top