Having an edit filed with format currency and Hint?

1 Answer 16 Views
Form
improwise
Top achievements
Rank 1
Iron
Iron
improwise asked on 09 Feb 2022, 02:36 PM | edited on 09 Feb 2022, 02:37 PM

Am I correct that it is currently not possible to have a form field that is both formatted as currency and has a hint text? In order to format as anything, it seems we need to use templates, and if we do, the stuff like HintText, Labeltext etc also goes missing? 

Having to always use templates for most basic stuff in grids, forms etc. like getting a bool to show up as a checkbox or a simple int to be displayed as currency, is really starting to get to me to be honest...

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 13 Feb 2022, 07:09 PM

Hi Patrick,

Yes, that is correct. On one hand, the Hint attribute relies on our built-in rendering. On the other hand, the FormItem <Template> allows full customization of the rendering. As a result, the two properties are mutually exclusive.

Perhaps we might support the DisplayFormatAttribute, so that the model property configuration is able to control the FormItem behavior. If you think this approach can be beneficial for you, we may consider this as a feature request.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

improwise
Top achievements
Rank 1
Iron
Iron
commented on 15 Feb 2022, 12:57 PM

Hi,

 

Does this also mean that it is impossible for format the text in form item to something like 0:C and still have a hint, as the Telerik Blazor form does not seem to support formatting so you have to use a template for each field and then the ability to use hint goes away as well?

Dimo
Telerik team
commented on 15 Feb 2022, 01:16 PM

I am not sure what is the difference between...

  • "it is currently not possible to have a form field that is both formatted as currency and has a hint text"
  • "it is impossible for format the text in form item to something like 0:C and still have a hint"

Both statements sound the same to me, but they are both correct.

improwise
Top achievements
Rank 1
Iron
Iron
commented on 15 Feb 2022, 01:20 PM

Sorry, was a bit unclear, even if we disregard the Hint problem, how would be format the contents of a Form item to something like 0:C without using templates? The Model is decorated as it should with

[DisplayFormat(DataFormatString = "{0:C}")]

but that does not seem to make a difference.

 

 

Dimo
Telerik team
commented on 15 Feb 2022, 03:19 PM

Yes, this will not work now, but that was my suggestion above - if we log built-in DisplayFormat support as a feature request and implement it, there will be no need for a FormItem template, and Hints will work too.
Tags
Form
Asked by
improwise
Top achievements
Rank 1
Iron
Iron
Answers by
Dimo
Telerik team
Share this question
or