Hello,
I am trying to sue SfAutocomplete for this very basic use case and it doesn't seem to work.
Basically I am trying to have an autocomplete field where I can search by name, the dropdown with matching results should also display the user name and once I select it should save the UserId associated with that user.
The documentation shows an example where it uses a "string" but I feel in at least 90% of the cases one needs to store an int instead. I'd like to make this default behavior work without having to add other events like onchange, etc.
FilteredTeamMembers is defined as List that contains a User attribute. I populate this List async from the DB when the page loads.
The form I am trying to bind is the following
In my @code section I declare the FormProjectUser variable as follows:
public frm_ProjectUser FormProjectuser { get; set; } = new frm_ProjectUser();
I've been struggling to make this work sometimes the page doesn't even load without giving me any error and after other attempts I've been able to store the ID to a different variable (not the form) but to do that I have to search by User ID and the dropdown displays the Full Name, when I select an item it stores the ID. This is obviously not the ideal scenario as the user needs to search by name.