Solved

Telerik raddatetimepicker

Posted on 2016-08-24
11
92 Views
Last Modified: 2016-08-25
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!
0
Comment
Question by:RIAS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 41769799
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>
0
 

Author Comment

by:RIAS
ID: 41769858
Hello Gautham Janardhan,
I am using vb.net windows can you please suggest in vb.net code
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 41769880
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

0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:RIAS
ID: 41769885
Hello Ramkisan,

Where do I put this code?On which event?
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 41769887
create a function and call it onLoad.
0
 

Author Comment

by:RIAS
ID: 41769891
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
0
 
LVL 12

Assisted Solution

by:Ramkisan Jagtap
Ramkisan Jagtap earned 500 total points
ID: 41769895
Private Sub RadDateTimePicker1_Opened(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadDateTimePicker1.Opened
  
Dim day As RadCalendarDay =  New RadCalendarDay()  
day.Date=DateTime.Now.Date 
day.ItemStyle.BackColor = System.Drawing.Color.LightBlue 
RadDateTimePicker1.SharedCalendar.SpecialDays.Add(day)       


End Sub 

Open in new window

0
 

Author Comment

by:RIAS
ID: 41769911
.SharedCalendar is not a member of radatetimpicker
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 41769916
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
0
 

Author Comment

by:RIAS
ID: 41769923
.SharedCalendar is not a member of radatetimpicker
0
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
ID: 41769933
My bad, as you are using RadDateTimePicker for winforms this will not be available.
Please check the following Teletik Forum:

http://www.telerik.com/forums/datetimepicker-highlight-today-s-date-only

Hope this helps.
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question