[PR #2291] DataBoundFormComponent: Generate FieldIdentifier if ValueChanged given #3180

Open
opened 2026-01-29 18:22:16 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/radzenhq/radzen-blazor/pull/2291

State: closed
Merged: Yes


i took a page out of FluentUI's book and noticed that they also make the field identifier if only ValueChanged is given

https://github.com/microsoft/fluentui-blazor/blob/dev/src/Core/Components/Base/FluentInputBase.cs#L315-L322

this allows validations to work if the user makes a one way binding (Value=@someProperty) and fills in ValueChanged(ValueChanged=@(value => SomeProperty=value)). we have come across the need to fill in the expression a few times in our application, so i have made a PR to help us (and anyone else) make validations work faster :)

this was tested in the RequiredValidatorDropDown.razor by changing @bind-Value=@model.CategoryName in TValue=string Value=@model.CategoryName ValueChanged=@(value => model.CategoryName=value) and worked nicely as both validations triggered.

**Original Pull Request:** https://github.com/radzenhq/radzen-blazor/pull/2291 **State:** closed **Merged:** Yes --- i took a page out of FluentUI's book and noticed that they also make the field identifier if only ValueChanged is given https://github.com/microsoft/fluentui-blazor/blob/dev/src/Core/Components/Base/FluentInputBase.cs#L315-L322 this allows validations to work if the user makes a one way binding (`Value=@someProperty`) and fills in ValueChanged(`ValueChanged=@(value => SomeProperty=value)`). we have come across the need to fill in the expression a few times in our application, so i have made a PR to help us (and anyone else) make validations work faster :) this was tested in the `RequiredValidatorDropDown.razor` by changing `@bind-Value=@model.CategoryName` in `TValue=string Value=@model.CategoryName ValueChanged=@(value => model.CategoryName=value)` and worked nicely as both validations triggered.
claunia added the pull-request label 2026-01-29 18:22:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#3180