Changing disable property programmatically

Hi,

I want to change the property of a dropdown box, so that it is originally disabled when I open a form page, but when I change the value of another preceeding dropdown-box it should be enabled and also mandatory so that user is forced to enter additional data. Is this possible? I checked the documentation and the forum but did not find something similar...

Best regards

Frank

Hi Frank,

You can set Disabled to check if the selection from previous DropDown is not null. For example: Disabled="@(CustomerID != null)". You will need also required validator:
https://blazor.radzen.com/requiredvalidator

Hi Enchev,

that sounds easy. When I enter my version:

Disabled = "${arbeitsberichte.berechkz == 'Berechnung'}"

into the field "Disabled" of the control I want to disable, then I get:

Invalid expression term ',' The name 'Disabled' does not exist in the current context

I think, I got you wrong...

Best regards

Frank

It works now. I simply have to write:

${arbeitsberichte.berechkz == "Berechnung"}

and to leave Disabled =

Thanks. Life can be easy :slight_smile:

Again me.

Can I control the requiredvalidator also programmatically?