Relative Content

Tag Archive for c#autocompletemudblazor

MudAutocomplete with a complex object to set text and value of edit form properties

I’m implementing an autocomplete function using MudAutocomplete. It works perfectly well if I simply want to bind the single search value into a model value in my editform. I cant figure out how to populate two values though. The autocomplete searches a list of agencies and puts the agency name into agency name property of the form but I also need to populate a hidden AgencyIdentifier field. Here’s a simplified sample of my edit form just showing the autocomplete (in reality there are many more input fields on the form, this is just for demo purposes)

MudAutocomplete with a complex object to set text and value of edit form values

I’m implementing an autocomplete function using MudAutocomplete. It works perfectly well if I simply want to bind the single search value into a model value in my editform. I cant figure out how to populate two values though. The autocomplete searches a list of agencies and puts the agency name into agency name property of the form but I also need to populate a hidden AgencyIdentifier field. Here’s a simplified sample of my edit form just showing the autocomplete (in reality there are many more input fields on the form, this is just for demo purposes)