title: How to bind Blazorise Multi-Select AutoComplete to Model
body: <p>I have a Blazor page in which the user can select multiple employees using autocomplete.</p>
  <p><a href="https://i.stack.imgur.com/LnFGs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LnFGs.jpg" alt="enter image description here" /></a></p>
  <pre><code>@page &quot;/Multi&quot;
  @uisng removed
  
  &lt;Autocomplete TItem=&quot;GraphUser&quot;
                TValue=&quot;string&quot;
                Data=&quot;@users&quot;
                TextField=&quot;@(( item ) =&gt; item.DisplayName)&quot;
                ValueField=&quot;@(( item ) =&gt; item.DisplayName)&quot;
                Placeholder=&quot;Search...&quot;
                Multiple
                @bind-SelectedValues=&quot;_multipleSelectionData&quot;
                @bind-SelectedTexts=&quot;_multipleSelectionTexts&quot;&gt;
  &lt;/Autocomplete&gt;
  
  @code {
  
      [Inject] public IGraphService GraphService { get; set; }
      public IEnumerable&lt;GraphUser&gt; users = new List&lt;GraphUser&gt;();
      protected override async Task OnInitializedAsync()
      {
          users = await GraphService.GetUsers();
          _multipleSelectionData = new List&lt;string&gt;();
          await base.OnInitializedAsync();
      }
      List&lt;string&gt; _multipleSelectionData;
      List&lt;string&gt; _multipleSelectionTexts = new();
  }
  </code></pre>
  <p>Now I need to bind this to a real field, and am totally at a loss on how to do that. The code sample below is what I need to replace. I need to bind the values the user selects to &quot;@ApprovalFlowForm.Other&quot;.</p>
  <p>Any suggestions would be greatly appreciated. Eventually I would like to just make the select part a component which I can call in and dynamically bind to different fields, but want to get this thing working first.</p>
  <pre><code>&lt;Label Display=&quot;Display.Flex&quot;&gt; Other &lt;/Label&gt;
  
  &lt;Select TValue=&quot;string&quot; @bind-SelectedValues=&quot;@ApprovalFlowForm.Other&quot; Multiple&gt;
  
  @{foreach (var item in GraphUserOptions)
      {
      &lt;SelectItem Value=&quot;@item.Value&quot;&gt;@item.Text&lt;/SelectItem&gt;
      }
  }
  &lt;/Select&gt;
  </code></pre>
  <p>My question was not clear enough.</p>
  <p>Below is the code that I am replacing:</p>
  <pre><code>&lt;div class=&quot;create-approval-flow-drop-down&quot;&gt;
                              &lt;Label Display=&quot;Display.Flex&quot;&gt; Director &lt;/Label&gt;
                              &lt;Select TValue=&quot;string&quot; @bind-SelectedValues=&quot;@ApprovalFlowForm.Director&quot; Multiple&gt;
                                  @{
                                      foreach (var item in GraphUserOptions)
                                      {
                                          &lt;SelectItem Value=&quot;@item.Value&quot;&gt;@item.Text&lt;/SelectItem&gt;
                                      }
                                  }
                              &lt;/Select&gt;
                              &lt;ValidationMessage For=&quot;@(() =&gt; ApprovalFlowForm.Director)&quot; /&gt;
                          &lt;/div&gt;
  </code></pre>
  <p>The key here is the line</p>
  <blockquote>
  <p>@bind-SelectedValues=&quot;@ApprovalFlowForm.Director&quot;</p>
  </blockquote>
  <p>The the previous code that &quot;works&quot; the selected Values are being bound to the Director field in the form &quot;ApprovalFlow&quot;. I am changing the way this field is accessed to use a blazorise autocomplete multi-select. That way the user can use type ahead and just enter a few letters of someone name and get a subsetted list. The current drop down just presents a list of literally 2,000 people that users must scroll through.</p>
  <p>I was able to get the code to work so that the user can use type ahead, but the last step, the step that I thought would be easy, was simply to bind it to the field in the model so we can write it to the database.</p>
  <p>I tried this</p>
  <pre><code>@bind-SelectedValues=&quot;@ApprovalFlowForm.LocManager&quot;
  </code></pre>
  <p>but when I do so I get the error &quot;Cannot convert from systems.collections.generic.ireadonlyList(strong) to System.Collections.Generic.List(String)&quot;.</p>
  <p>I imagine this is telling me exactly what to do, but I cannot figure out what that is.</p>
  <p>Thanks.</p>