RadControls for ASP.NET AJAX The OnDateSelecting client-side event handler is called immediately before the selected dates collection is updated to reflect the selection or deselection of a date.
Note |
|---|
The OnDateSelecting event is supported by: RadCalendar. |
Two parameters are passed to the event handler:
The following example uses the OnDateSelecting event to confirm a change of selection and cancel the change if the user does not confirm:
CopyASPX
<script type="text/javascript">
function ConfirmChange(sender, eventArgs) {
var date = eventArgs.get_renderDay().get_date();
var dfi = sender.DateTimeFormatInfo;
var formattedDate = dfi.FormatDate(date, dfi.ShortDatePattern);
eventArgs.set_cancel(!confirm("Are you sure you want to " +
(eventArgs.get_isSelecting() ? "select " : "unselect ") +
formattedDate + "?"));
}
</script>
<telerik:RadCalendar ID="RadCalendar1" runat="server">
<ClientEvents OnDateSelecting="ConfirmChange" />
</telerik:RadCalendar>
See Also