How to get date has just be selected (click)

4 posts, 0 answers
  1. Thanh
    Thanh avatar
    9 posts
    Member since:
    Dec 2015

    Posted 21 Jan Link to this post

    Hi,

     

    I have a week is selected, then I click a date more, how can I get the last date I have just clicked.

     

    Look forward your reply,

    Pham Thanh

  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 22 Jan Link to this post

    Hi Thanh,

    Thank you for writing.

    RadCalendar features SelectionChanging event, which will get triggered when the selection has been changed. In your scenario, in the event handler you can access the e.NewDates property to get the newly selected date.

    More information on the events provided by RadCalendar, can be found here.

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Thanh
    Thanh avatar
    9 posts
    Member since:
    Dec 2015

    Posted 22 Jan in reply to Stefan Link to this post

    Hi Stefan,

    I want to describe about my scenario. When I click on a day, I want whole week is selected instead of one day, so I can not use SelectionChanging  event, because when user click, the SelectionChanging is raised, then I get the selected date by e.NewDates, I calculate and add dates in week from that date, then add to SelectedDates property, this will raise SelectionChaging again.

     Therefore, I don't use SelectionChanging event, I use Click event and get the last clicked date from FocusedDate Property. I have just found this property, and it work find.

     Thank for your answer.

    Pham Thanh

  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 22 Jan Link to this post

    Hello Thanh,

    I am glad you found a way to handle your scenario, indeed the Click event is the other option.

    I would like to just add, that row/column selection is available as build-in functionality with the column/row headers. Here you can find more information on this matter: http://docs.telerik.com/devtools/winforms/calendar/customizing-behavior/column-and-row-headers and also here is a small snippet:
    radCalendar1.AllowMultipleSelect = true;
    radCalendar1.ShowRowHeaders = true;
    radCalendar1.AllowRowHeaderSelectors = true;

    I hope that you find this information useful.

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top