Closing RadDateRangePicker popup

0 Answers 39 Views
DateRangePicker
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
SSirica asked on 04 Oct 2023, 06:31 PM
Is there a way to close the date range popup automatically once the end date has been chosen?  I know you can close it by clicking somewhere outside the popup, but users are dumb and that may not be intuitive enough.  
Rumen
Telerik team
commented on 06 Oct 2023, 01:44 PM

Here is a basic example leveraging the client-side API of the DateRangePicker control: 

<telerik:RadDateRangePicker RenderMode="Lightweight" ID="RadDateRangePicker1" runat="server">
    <ClientEvents OnDateSelected="OnDateSelected" />
</telerik:RadDateRangePicker>
<script>    
    function OnDateSelected(sender, args) {
        if (sender.get_endDatePicker().get_selectedDate() != null) {
            sender.hidePopup();
        }
    }
</script>

SSirica
Top achievements
Rank 3
Iron
Iron
Iron
commented on 06 Oct 2023, 01:50 PM

Thanks.

No answers yet. Maybe you can help?

Tags
DateRangePicker
Asked by
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
Share this question
or