Solved

Telerik raddatetimepicker

Posted on 2016-08-24
11
40 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
  • 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
 

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now