New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

OnPopupClosing

The OnPopupClosing client-side event handler is called just before a popup calendar is closed.

The OnPopupClosing event is supported by: RadDatePicker , RadTimePicker , and RadDateTimePicker .

The event handler receives two arguments:

  1. the object that fired the event.

  2. an event arguments object that exposes the following methods:OnPopupClosing event arguments object

NameReturn TypeArgumentsDescription
get_popupControl()Calendar client-side objectReturns the client object for the time view or calendar that is about to close.
set_cancel(value)boolLets you prevent the popup from closing.

The following example uses the OnPopupClosing event to prevent the popup from closing if nothing is selected:

JavaScript
function popupClosing(sender, eventArgs) {
	var popup = eventArgs.get_popupControl();
	
	if (popup.get_selectedDates().length == 0) {
		alert("You must select a date!");
		eventArgs.set_cancel(true);
	}
}
ASPNET
<telerik:RadDatePicker RenderMode="Lightweight" ID="RadDatePicker1" runat="server">
    <Calendar DayNameFormat="FirstLetter"
           UseColumnHeadersAsSelectors="False"
           UseRowHeadersAsSelectors="False">
    </Calendar>
    <ClientEvents OnPopupClosing="popupClosing" />
</telerik:RadDatePicker>		

See Also

In this article
See Also
Not finding the help you need?
Contact Support