RadDatePicker - Highlight today's date on calendar

27 posts, 0 answers
  1. Siva
    Siva avatar
    9 posts
    Member since:
    Dec 2008

    Posted 16 Jun 2009 Link to this post

    Hello,

    I am using a RadDatePicker control to select a date. I want to highlight today's date on the calendar pop up. I have read a couple of previous posts related to this. But I could not get my code work. Following is my current RadDatePicker code.

    <telerik:RadDatePicker ID="beginDateTimePicker" runat="server" Skin="Vista"
        <DateInput LabelCssClass="radLabelCss_Vista" Skin="Vista" EmptyMessage="mm/dd/yyyy" 
            DateFormat="MM/dd/yyyy"
            <EmptyMessageStyle Font-Italic="True" Font-Size="8pt" /> 
            <HoveredStyle Font-Italic="True" Font-Size="8pt" /> 
        </DateInput> 
        <Calendar Skin="Vista" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
            ViewSelectorText="x" ShowOtherMonthsDays="False" ShowRowHeaders="False"
            <SpecialDays> 
                <telerik:RadCalendarDay Repeatable="Today"
                    <ItemStyle CssClass="Yellow" /> 
                </telerik:RadCalendarDay> 
            </SpecialDays> 
        </Calendar> 
        <DatePopupButton CssClass="radPopupImage_Vista" /> 
    </telerik:RadDatePicker> 

    Please help me on this issue.

    Thank You,
    Siva
  2. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 16 Jun 2009 Link to this post

    Hello Siva,

    Please try the following modification:
    ... 
    <ItemStyle CssClass="rcToday" />  

    Let me know whether this helps.

    Regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Siva
    Siva avatar
    9 posts
    Member since:
    Dec 2008

    Posted 16 Jun 2009 Link to this post

    Hello Daniel,

    I tried the modification which you suggested. But it did not work.

    Thanks,
    Siva

  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 16 Jun 2009 Link to this post

    Hello Siva,

    I tried to reproduce the issue locally without avail. Could you modify the attached demo to help me recreate your scenario?

    Best regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Siva
    Siva avatar
    9 posts
    Member since:
    Dec 2008

    Posted 16 Jun 2009 Link to this post

    Hello Daniel,

    I have executed your demo and it did not work either.

    In my page I have another RadDatePicker control and a  Button control. In the click event of Button I am showing Telerik report.

    I am having all these in the ContentPlaceHolder of my master page.

    Thanks,
    Siva



  7. Siva
    Siva avatar
    9 posts
    Member since:
    Dec 2008

    Posted 16 Jun 2009 Link to this post

    Hello Daniel,

    Finally I found the problem. I have set the backcolor for RadCalendarDay itemstyle and I could see the date highlighted.

    Thanks for your concern and your suggestions.

    Thanks,
    Siva
  8. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 07 Feb 2011 Link to this post

    Picking up on this, isn't this behavior to be considered as a bug really? I mean, shouldn,t the RadDatePicker by default be able to display the SelectedDate? To be honest, shouldn't the RadDatePicker just have an "highlight today" option in the SmartTag, as I guess it is something almost everyone would like to do?
  9. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 08 Feb 2011 Link to this post

    Hello Patrik,
     
    I mean, shouldn,t the RadDatePicker by default be able to display the SelectedDate?
    RadDatePicker already displays the date that is selected in the date input control.

    To be honest, shouldn't the RadDatePicker just have an "highlight today" option in the SmartTag, as I guess it is something almost everyone would like to do?
    Indeed this is a good idea, thank you. I will pass it to our development team for consideration.

    Best regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  10. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 08 Feb 2011 Link to this post

    My misstake, what I meant was that it should be able to highlight todays date by default if set, not forcing the developer to have to change backgrounds to see it.
  11. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 11 Feb 2011 Link to this post

    Hello Patrik,

    If there are no unforeseen difficulties we will implement this functionality in some of the next releases of RadControls for ASP.NET AJAX.

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  12. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 15 Apr 2011 Link to this post

    I second Patrick, this is a lot of work for something that everybody wants to do by default.

    A property to disable this would be nice. To disable, because I think this should be on by default. It's just plain weird to not have the today's day highlighted.

    <telerik:RadDatePicker runat="server" ID="datDebut" DatePopupButton-ToolTip="Afficher le calendrier" DateInput-EmptyMessage="Début">
                        <Calendar>
                            <FastNavigationSettings TodayButtonCaption="Aujourd'hui" CancelButtonCaption="Annuler" />
                            <SpecialDays>
                                <telerik:RadCalendarDay Repeatable="Today">
                                    <ItemStyle CssClass="rcToday" />
                                </telerik:RadCalendarDay>
                            </SpecialDays>
                        </Calendar>
                    </telerik:RadDatePicker>
  13. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 18 Apr 2011 Link to this post

    Hello John,

    We will add an option in the Smart tag's context menu that will allow you to enable/disable the today date with a single mouse click. Please note that we could not make this a default behavior, as it will be a breaking change.

    Kind regards,
    Daniel
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  14. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 18 Apr 2011 Link to this post

    Good news. No problem, I understand,
    Thanks,
    John.
  15. Abhishek
    Abhishek avatar
    21 posts
    Member since:
    Mar 2011

    Posted 24 Jun 2011 Link to this post

    Hi,

    I have added RadDatePicker control dynamically.
    How can i set today date highlighted?

    i have done this.

     

     

    Dim datePicker As New RadDatePicker

     

     

     

    Dim radCalendarDay As New RadCalendarDay()

     

    radCalendarDay.Repeatable =

     

    RecurringEvents.Today

     

    radCalendarDay.ItemStyle.CssClass =

     

    "rcToday"

     

    datePicker.Calendar.SpecialDays.Add(radCalendarDay)

  16. chris
    chris avatar
    22 posts
    Member since:
    Aug 2012

    Posted 26 Oct 2011 Link to this post

    When will this feature be released?
  17. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 27 Oct 2011 Link to this post

    Hello Chris,
    What feature are you talking about?
    Can you be more specific in what you need?
    Thank you,
    John.
  18. chris
    chris avatar
    22 posts
    Member since:
    Aug 2012

    Posted 27 Oct 2011 Link to this post

    Sorry, I replied to @Daniel (http://www.telerik.com/community/forums/aspnet-ajax/calendar/raddatepicker---highlight-today-39-s-date-on-calendar.aspx#1609470), but my post ended up at the bottom.

    I was talking about the ability to highlight today's date in the calendar from the smart tag, rather than remembering to copy/paste 5 lines of code every time.
  19. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 31 Oct 2011 Link to this post

    Hello Chris,

    This feature is already implemented. Here is a screenshot:

    Best regards,
    Daniel
    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
  20. Michael Malone
    Michael Malone avatar
    68 posts
    Member since:
    May 2010

    Posted 29 Nov 2011 Link to this post

    Daniel,

    Is there a property to set to do this without having to use the smart tag or the designer? 
  21. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Nov 2011 Link to this post

    Hello,

    You can try the following code snippet to highlight today's date.
    CS:
    protected void Page_Load(object sender, EventArgs e)
       {
         RadCalendarDay day = new RadCalendarDay();
         day.Date = DateTime.Now.Date;
         day.ItemStyle.BackColor = System.Drawing.Color.Red;
         RadDatePicker1.Calendar.SpecialDays.Add(day);
      }

    Thanks,
     Princy.
  22. Michael Malone
    Michael Malone avatar
    68 posts
    Member since:
    May 2010

    Posted 29 Nov 2011 Link to this post

    That's a lot of code for something so simple and useful. Are there plans for add a property to do this? Every Calendar control I've used in the past has highlighted Today's date by default. 
  23. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 02 Dec 2011 Link to this post

    Hello Michael,

    Yes, this functionality will be added in a future version of RadControls for ASP.NET AJAX.

    Regards,
    Daniel
    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
  24. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 20 Apr 2012 Link to this post

    Not sure why but it seems this option "Highlight todays date" is not available in the RadDatePicker, just the RadCalendar, why is this? It seems obvious that it should be available in both cases. Have to admit that at the time of writing this, I don't really know the differences between RadCalendar and RadDatePicker but will look into it.

    Edit:
    Seems like the only difference is that the Calendar is rendered as a full calendar, which should make it useless for any filtering options with RadGrid (well, most at least). If so, this issue still isn't resolved, as the DatePicker doesn't have a "Highlight today" option, at least not what I could find. 
  25. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 25 Apr 2012 Link to this post

    Hello Patrik,

    Yes, this option is available for RadCalendar only. Our developers will implement this option for the picker controls in a future version of RadControls for ASP.NET AJAX.

    Kind regards,
    Daniel
    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.
  26. Karrie
    Karrie avatar
    12 posts
    Member since:
    Feb 2013

    Posted 11 Apr 2014 Link to this post

    We would like to do this (apply a class or a style to 'today' on a RadCalendar), but only do it once for, say, an entire project rather than configuring the style each time we add a RadDatePicker or Calendar.

    For example, what if we always want to automatically apply the same CSS class to any SpecialDay added to a calendar object?

    What are some techniques for accomplishing this?
  27. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 15 Apr 2014 Link to this post

    Hello Karrie,

    The easiest way to apply the special days to all calendars would be to use an ASP.NET Theme.
    How to: Define ASP.NET Page Themes
    How to: Apply ASP.NET Themes

    .skin file
    <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
     
    <telerik:RadCalendar runat="server">
        <SpecialDays>
            <telerik:RadCalendarDay Repeatable="Today">
                <ItemStyle CssClass="rcToday" />
            </telerik:RadCalendarDay>
        </SpecialDays>
    </telerik:RadCalendar>

    ASP.NET Page directive:
    <%@ Page ... Theme="YourThemeName" %>

    Let me know if you need more information.

    Regards,
    Daniel
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  28. Eric
    Eric avatar
    1 posts
    Member since:
    Aug 2012

    Posted 20 Dec 2015 in reply to Princy Link to this post

    This helped a lot with my project. Thank you.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017