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

Closed
opened 2026-01-29 17:53:47 +00:00 by claunia · 4 comments
Owner

Originally created by @paritoshromy on GitHub (Oct 26, 2024).

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.

Originally created by @paritoshromy on GitHub (Oct 26, 2024). 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.
Author
Owner

@franklupo commented on GitHub (Oct 26, 2024):

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

Best regards

@franklupo commented on GitHub (Oct 26, 2024): Good idea, but in my case the label must go through StringLocalizer. Best regards
Author
Owner

@paritoshromy commented on GitHub (Oct 26, 2024):

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.

@paritoshromy commented on GitHub (Oct 26, 2024): 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.
Author
Owner

@franklupo commented on GitHub (Oct 28, 2024):

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

@franklupo commented on GitHub (Oct 28, 2024): global localization would be awesome. a method with 2 parameters type and text to translate.
Author
Owner

@akorchev commented on GitHub (Nov 27, 2025):

I don't think this can be easily implemented as RadzenLabel doesn't know the model or property. So the DisplayAttribute can't be obtained.

@akorchev commented on GitHub (Nov 27, 2025): I don't think this can be easily implemented as RadzenLabel doesn't know the model or property. So the DisplayAttribute can't be obtained.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1448