MultiSelect for UWP
MultiSelect コントロールの使用

MultiSelect allows you to add, remove, and access specific items with minimal code. It also lets you display or hide the check boxes and dropdown button appearing in the control. Learn how they can be implemented.

Add an item

To add items to the MultiSelect control, use Add method of ItemCollection class as shown in the following code. For example, the following code adds “Edward” in dropdown list of the MultiSelect control:

C#
コードのコピー
mselect.Items.Add("Edward");

MultiSelect also allows you to add an item at a specific position using Insert method of ItemCollection class and specify an index value for the new item in it. For example, the following code inserts a name, Robert, to the second position, adjusting the position of the other items in the dropdown list:

C#
コードのコピー
mselect.Items.Insert(1, "Robert");
Back to Top

Edit an item

MultiSelect provides you an option to allow or restrict a user to edit tags in the control header through IsTagEditable property.

C#
コードのコピー
mselect.IsTagEditable = false;
Back to Top

Remove an item

MultiSelect lets you delete an item from the list using RemoveAt method of ItemCollection class as shown in the following code. The method takes one argument, index, which specifies the item to remove. For example, the following code deletes sixth entry from the list.

C#
コードのコピー
mselect.Items.RemoveAt(5);

MultiSelect also allows you to delete a selected item from the MultiSelect control using Remove method as shown in the following code:

C#
コードのコピー
mselect.Items.Remove(mselect.SelectedItem);

To remove all the entries from the list, use Clear method as shown in the following code:

C#
コードのコピー
mselect.Items.Clear();
Back to Top

Access specific item

To access and change a specific item from the MultiSelect control dropdown list, use Items property of C1MultiSelect class and specify the index of that item. For example, to access and change the value of second item from the list, write the following line of code:

C#
コードのコピー
mselect.Items[1] = "Jake";
Back to Top

Show/Hide dropdown button

MultiSelect displays the dropdown button to show the list of available items. However, you can hide the dropdown button in the control by setting ShowDropDownButton property to false.

To hide the drop down button, use the following code:

C#
コードのコピー
mselect.ShowDropDownButton = false;
Back to Top