RadzenDatePicker: How to Close Popup After Clicking 'Today' Button?

I'm working with RadzenDatePicker and have added a "Today" button in the footer.
Everything works fine, but the issue is that when I click the "Today" button, I want the date picker popup to close automatically.

I tried using the @ref property with xDatePicker?.Close(), but it doesn’t seem to work.

Any suggestions?

Just tried this code in our demos and it worked:

<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center" Gap="0.5rem" class="rz-p-12">
    <RadzenLabel Text="Select Date" Component="RadzenDatePickerBindValue" />
    <RadzenDatePicker @ref=picker @bind-Value=@value Name="RadzenDatePickerBindValue" ShowCalendarWeek>
        <FooterTemplate>
            <RadzenButton Click=@(args => picker.Close()) />
        </FooterTemplate>
    </RadzenDatePicker>
</RadzenStack>

@code {
    RadzenDatePicker<DateTime?> picker;
    DateTime? value;
}
1 Like

Yes, it worked after a few tries. Thanks!