Solved

Telerik raddatetimepicker

Posted on 2016-08-24
11
83 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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