RadCalendar for ASP.NET

OnDateSelecting Send comments on this topic.
Telerik RadCalendar Client-Side > Client-Side Events > OnDateSelecting

Glossary Item Box

 

Fired

Before the date to be selected is added/removed to the selected dates collection.

Arguments

calendarInstance - the Telerik RadCalendar instance that raised the event.

args (composite argument)

  • args.RenderDay - a RenderDay object corresponding to the server-side RadCalendarDay.
  • args.IsSelecting - boolean variable that denotes whether the Telerik RadCalendar is in the process of selecting (or unselecting) the date

Can be cancelled

Yes, return false to cancel.

Example

ascx/aspx

Copy Code
<radc:radcalendar id="Ca1endar1" runat="server">
    <ClientEvents
      OnDateSelecting="Calendar_OnDateSelecting">
   </ClientEvents>
</radc:radcalendar>

JavaScript

The javascript function for implementing the OnDateSelecting event looks  like this:
Copy Code
function Calendar_OnDateSelecting(calendarInstance, args)
{
    ....
    return confirm("OnDateSelecting: " + args.RenderDay.Date, (args.IsSelecting ? "Select" : "Unselect") + " " + args.RenderDay.Date + "?");
}
Remarks

 This event can be used to conditionally process the selected date or any related event with it on the client.