Completed
Last Updated: 27 Oct 2021 08:47 by ADMIN
Release 2.28.0
Robert
Created on: 09 Feb 2020 21:26
Category: DatePicker
Type: Feature Request
47
Placeholder for DatePicker (and the other date inputs)

How to remove placeholder from DatePicker?

If I set DateFormat to "d" then DatePicker will have "d" as a placeholder which confuses my users. How can I set custom placeholder or remove the placeholder from the DatePicker control?

Best regards,

Robert

4 comments
ADMIN
Marin Bratanov
Posted on: 29 Jul 2021 18:33

Hi,

At the moment, the date input (and the various date/time pickers) don't have a placeholder yet, please click the Follow button on this page to know when it gets implemented. Once it is, you will be able to inspect the rendered HTML and devise a CSS rule to style it in case the built-in rules do not match your needs.

 

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

How PK
Posted on: 29 Jul 2021 08:52
Possible to change the placeholder CSS?
Daniel
Posted on: 29 Apr 2020 07:13

@Robert

I have the same requirement hence +1 for this thread. You can use the following workaround to hide the placeholder when no value is given:

<TelerikDateInput Value="@Value" Format="@Format" 
...
@{
  private DateTime? Value { get; set; }
  private string Format { get; set; }

  // code section

  Format = Value.HasValue ? "d" : "";
}
ADMIN
Marin Bratanov
Posted on: 10 Feb 2020 10:04

Hello Robert,

I moved this thread to the public feedback portal so you can Follow the status of such a feature (I took the liberty of tweaking the title a little): https://feedback.telerik.com/blazor/1452940-placeholder-for-datepicker-and-the-other-date-inputs.

At the moment, all the date inputs (which all boil down to a TelerikDateInput) show their Format as a placeholder. Options I can suggest are as workarounds:

  • have a default value so that the user sees an actual date
  • use a custom format string (see the supported ones here) that is a little more verbose (like the default one) so the user sees a more meaningful hint

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor