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

Calendar customization issues on hosting

1 Answer 82 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Remya
Top achievements
Rank 1
Remya asked on 26 Mar 2012, 08:25 AM
Hi,

I had customized my radcalendar for displaying Hijri dates along with Gregorian.It works fine on my local machine but when hosting the Hijri dates from 13th to last date of every month is invisible.I am attaching a screenshot along with this for your reference.

Here my code is;

Protected Sub RadCalendar1_DayRender(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs) Handles radCal1.DayRender
        Dim label As New Label()
        Dim div As HtmlGenericControl = New HtmlGenericControl("div")
        div.Attributes.Add("class", "CalG")
        label.Text = e.Day.[Date].Day.ToString()  'Gregorian Day
        div.Controls.Add(label)
        Dim div1 As HtmlGenericControl = New HtmlGenericControl("div")
        div1.Attributes.Add("class", "CalH")
        Dim label1 As Label = New Label()
        label1.ForeColor = Drawing.Color.Brown
        Dim d As DateTime = e.Day.Date
        Dim objDateConv As New DatesConversion
        label1.Font.Size = FontSize.Small
        label1.Height = "5"
        label1.Text = objDateConv.GregToHijri(d, "Day") & "/" & objDateConv.GregToHijri(d, "Month")  'hijri Day and month
        div1.Controls.Add(label1)
        If e.Day.Date.DayOfWeek = 4 Then  'Disable week day
            Dim calendarSkin = radCal1.Skin
            If (calendarSkin = "") Then
                calendarSkin = "Default"
            End If
            Dim otherMonthCssClass As String = String.Format("otherMonth_{0}", calendarSkin)
            e.Cell.Text = ""
            e.Cell.CssClass = otherMonthCssClass ' set new CssClass for the disabled calendar day cells (e.g. look like other month days here)
            Dim calendarDay As RadCalendarDay = New RadCalendarDay
            calendarDay.Date = e.Day.Date
            calendarDay.IsSelectable = False
            calendarDay.ItemStyle.CssClass = otherMonthCssClass
            radCal1.SpecialDays.Add(calendarDay)
            e.Cell.BackColor = Drawing.Color.LightYellow 
        End If
        div.Attributes.Add("class", "CalG")
        div1.Attributes.Add("class", "CalH")
        e.Cell.Controls.Add(div)
        e.Cell.Controls.Add(div1)
    End Sub

Thnx in advance.

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 29 Mar 2012, 09:13 AM
Hello Remya,

RadCalendar supports all the cultures in the System.Globalization namespace that are based only on the Gregorian calendar. We are not able to provide you a solution for your custom implementation, because it is out of our scope.

Regards,
Milena
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Calendar
Asked by
Remya
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or