Link to home
Create AccountLog in
Avatar of Rias
RiasFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Telerik raddatetimepicker

Hello,
Is there a way to highlight todays date on the datetimepicker calendar. I am using telerik raddatetimepicker. Is it setting a special day?

Cheers!
Avatar of Gautham Janardhan
Gautham Janardhan

Hi RIAS,

Can you please try this?

 
<telerik:RadDatePicker runat="server">
    <Calendar runat="server">
        <SpecialDays>
            <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="Red">
            </telerik:RadCalendarDay>
        </SpecialDays>
    </Calendar>
</telerik:RadDatePicker>
Avatar of Rias

ASKER

Hello Gautham Janardhan,
I am using vb.net windows can you please suggest in vb.net code
Dim _fromControl As RadDatePicker =  New RadDatePicker()  
Dim day As RadCalendarDay =  New RadCalendarDay()  
day.Date=DateTime.Now.Date 
day.ItemStyle.BackColor = System.Drawing.Color.LightBlue 
_fromControl.Calendar.SpecialDays.Add(day)

Open in new window

Avatar of Rias

ASKER

Hello Ramkisan,

Where do I put this code?On which event?
create a function and call it onLoad.
Avatar of Rias

ASKER

Hello,

Getting an error : calendar is not a member of raddatetimepicker ?

Had found a code on telerik blog but the app is crashing as soon as it hits the code :

'Private Sub RadDateTimePicker1_Opened(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadDateTimePicker1.Opened
    '    Dim dtcalendar As RadDateTimePickerCalendar = DirectCast(Me.RadDateTimePicker1.DateTimePickerElement.GetCurrentBehavior(), RadDateTimePickerCalendar)
    '    Dim calendar As RadCalendar = dtcalendar.Calendar
    '    calendar.SpecialDays.Add(New RadCalendarDay(New Date(2010, 11, 10)))
    'End Sub
SOLUTION
Avatar of Ramkisan Jagtap
Ramkisan Jagtap
Flag of Finland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Rias

ASKER

.SharedCalendar is not a member of radatetimpicker
Please check this,



Protected Sub Page_Load(ByVal sender As Object, _
        ByVal e As System.EventArgs) Handles Me.Load

    If Not IsPostBack Then

Dim day As RadCalendarDay =  New RadCalendarDay()  
day.Date=DateTime.Now.Date
day.ItemStyle.BackColor = System.Drawing.Color.Red
RadDateTimePicker1.SharedCalendar.SpecialDays.Add(day)      

 End If
End Sub
Avatar of Rias

ASKER

.SharedCalendar is not a member of radatetimpicker
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account