radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.58k stars 798 forks source link

Feature Request : RadzenLabel bound to input component should be able to get the text from bound Input data annotation display attribute. #1757

Open paritoshromy opened 1 week ago

paritoshromy commented 1 week ago

One of the things that I loved about MVC is the asp-for on label elements. The ability to just provide the display name once as a data annotation and then reuse it at multiple places is really good.

Radzen label text needs to be typed as independent texts. If possible to pick the text from data annotation if custom text attribute is not specified. The label text should come from the component it is tied to. This will improve the development speed for CRUD forms a lot.

This thing can then be replicated to RadzenColumn and the Column header can come as default from the bound property data annotation attribute.

Another cool feature can be adding the required red star symbol if the data annotation has a required property.

franklupo commented 1 week ago

Good idea, but in my case the label must go through StringLocalizer.

Best regards

paritoshromy commented 1 week ago

Localisation makes it bit tricky but I think that can be manageable through a custom function on the improved label component…need to give it a proper try though.

franklupo commented 1 week ago

global localization would be awesome. a method with 2 parameters type and text to translate.