Multi select droplist

Hi!

Could someone help me with setting up the DB structure I need to have to generate a multi-select drop list.

For example for a certain alert I need to select from a list of users to send to only the selected ones.

Many Thanks!

Xarion

First define a string array :

IEnumerable<string> selectedUsers = new string[] {};

You will need to set @bind-Value=@selectedUsers to the defined array and also Multiple="true" attribute of dropdown to enable multiple selection in dropdown. Selected values will be obtained in selectedUsers array for more details you can refer the code sample

Hi Vinod

Thanks I have seen the docs however it doesn't help me

  1. the data needs to be dynamic pulling from a table as opposed to something static
  2. how does the DB structure need to look for a one-to-many generation/insertion.

Thanks!

This has been implemented in the sample multiselected dropdown

For data input forms try this link which will give you a fair idea for implementing one-to-many also refer to the sample northwind database customers and orders tables for structure information