This is a migrated thread and some comments may be shown as answers.

Get clicked date

2 Answers 23 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Per
Top achievements
Rank 1
Per asked on 02 Mar 2012, 10:25 PM
Hi!

I need to get the clicked date in the RadCalendar, regardless if it was selected or deselected. I know you can do is on the clientside, but I need to to this serverside.

I'v tried with the method RadCalendar_SelectionChanged, but then I only get an array of selected dates, not any information about the last date that triggered the event handler.

Is this possible?

Best regards,
P

2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 Mar 2012, 11:18 PM
Hi,

You can examine the code snippet below in order to retrieve the last selected date :
protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)
{
    if (e.SelectedDates.Count != 0)
    {
        Response.Write(e.SelectedDates[e.SelectedDates.Count - 1].Date.ToString()); // Last selected date
    }
 
}
 
Greetings,
Pavlina
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.
0
DogBizPro
Top achievements
Rank 1
answered on 11 Sep 2015, 06:11 PM

Is there a way to get the actual clicked date? I am having issues because when someone clicks a date I want to select the dates for a specific range which works fine, but if the client then clicks on that date again the last selected date is the last of the initial range I programatically selected vs what is actually selected.

I just really need to format these dates differently so the client knows how long of a service they are booking. I am already using special dates to block off closed days/holidays so how can I just format them differently if not using the selected dates?

Tags
Calendar
Asked by
Per
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
DogBizPro
Top achievements
Rank 1
Share this question
or