This is a migrated thread and some comments may be shown as answers.

ShowOtherMonthsDays issue with custom special days

1 Answer 56 Views
This is a migrated thread and some comments may be shown as answers.
shaik Mohammed
Top achievements
Rank 1
shaik Mohammed asked on 27 Oct 2015, 04:01 PM

Hi I'm using OnDayRender to disable special days.

so have added below code


<telerik:RadDatePicker Calendar-DayNameFormat="Shortest" Calendar-ShowOtherMonthsDays="false" DateInput-ReadOnly="true" DatePopupButton-ImageUrl="/images/calander_icon.gif" DatePopupButton-HoverImageUrl="/images/calander_icon.gif"
                                                                  ID="rdpDeliveryDate" OnLoad="rdpDeliveryDate_Load"  runat="server" >
                                                                 <Calendar ID="Calendar1" runat="server" ShowRowHeaders="false"  OnDayRender="dayRender"  ShowFastNavigationButtons="false" FirstDayOfWeek="Sunday"></Calendar>



protected void dayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
if (e.Day.Date.DayOfWeek == DayOfWeek.Friday|| e.Day.Date.DayOfWeek == DayOfWeek.Saturday)
                        // clear the default cell content (anchor tag) as we need to disable the hover effect for this cell
                        e.Cell.Text = "";
                        e.Cell.CssClass = "rcOutOfRange"; //set new CssClass for the disabled calendar day cells (e.g. look like other month days here)
                        // render a span element with the processed calendar day number instead of the removed anchor -- necessary for the calendar skinning mechanism
                        Label label = new Label();
                        label.Text = e.Day.Date.Day.ToString();
                        e.Cell.ToolTip = "Day Off";
                        RadCalendarDay dayoff = new RadCalendarDay();
                        dayoff.Date = e.Day.Date;
                        dayoff.IsSelectable = false;
                        dayoff.IsDisabled = true;
                        dayoff.ItemStyle.CssClass = "rcOutOfRange";

I'm using  Version 2015.2.826.45,
Visual studio 2012.

but still other month of special days showing in the calendar. please check the attached screen shot


appropriate for quick and best response.




1 Answer, 1 is accepted

Sort by
Telerik team
answered on 30 Oct 2015, 08:18 AM
Hi Yasin,

Please check the samples provided in the following post and let me know about the result on your side:

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
Asked by
shaik Mohammed
Top achievements
Rank 1
Answers by
Telerik team
Share this question