Completed
Last Updated: 21 Jan 2022 13:22 by ADMIN
John af P
Created on: 09 Jan 2022 10:29
Category: DatePicker
Type: Feature Request
1
Add doubleclick event to date controls

The normal InputDate in blazor has an @ondblclick event. The intellisense for TelerikDatePicker indicates that this should be available but gives the error "...does not have a property matching the name 'ondblclick'."

3 comments
ADMIN
Hristian Stefanov
Posted on: 21 Jan 2022 13:22

Hi John,

In such a case, you can easily handle a double-click event for the DatePicker by wrapping our component inside a span. I have prepared for you an example below, following this knowledge base article steps - "Capture input keyboard events".

<span @ondblclick="@DblHandler">
    <TelerikDatePicker @bind-Value="datePickerValue"></TelerikDatePicker>
</span>

@code {
    DateTime? datePickerValue { get; set; } = DateTime.Now;

    void DblHandler(MouseEventArgs e)
    {
        datePickerValue = null;
    }
}

Please test the above code to see the desired result.

I'm marking this public item as "Completed" as I will add the above sample as a knowledge base article example.

Thank you for sharing with us the use case here.

Regards,
Hristian Stefanov
Progress Telerik

Learn about the important changes coming in UI for Blazor 3.0 in January 2022!
John af P
Posted on: 16 Jan 2022 15:20
My use case, which I have used before, is to set a nullable DateTime to todays date on dubble click. It saves having to open the calendar to do this.
ADMIN
Hristian Stefanov
Posted on: 16 Jan 2022 13:03

Hi John,

Thank you for giving an idea to add a "@ondbclick" event.

This seems like a valid feature request. Can you please share with us possible scenarios where the event is needed? We want to explore the use cases of the event before we make it to "Unplanned" so we can meet our customers needs.

I look forward to your reply. 

Regards,
Hristian Stefanov
Progress Telerik

Learn about the important changes coming in UI for Blazor 3.0 in January 2022!