Multi-Item Input

C1 MVC has several controls you can use to select multiple items from a list:

  • MultiSelect: This is a drop-down control that extends ComboBox and adds checkboxes next to each item in the drop-down list. Currently checked items are exposed through the checkedItems property.
  • MultiAutoComplete: This is a drop-down control that extends AutoComplete so selected items are shown as 'tokens' next to the control header, where they can be removed with the mouse or keyboard. Currently selected items are exposed through the selectedItems property.
  • ListBox: The ListBox control has a checkedMemberPath property that allows you to add checkboxes to items on the list. It has a checkedItems property that gets or sets the list of checked items.
1
2
3
4
5
6
7
8
9
10
11
12
13
using System.Web.Mvc;
 
namespace LearnMvcClient.Controllers
{
    public partial class C1InputController : Controller
    {
        // GET: MultiItem
        public ActionResult MultiItem()
        {
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<h1>
    @Html.Raw(Resources.C1Input.MultiItem_Title)
</h1>
 
<p>
    @Html.Raw(Resources.C1Input.MultiItem_Text1)
</p>
<ul>
    <li>
        @Html.Raw(Resources.C1Input.MultiItem_Text2)
    </li>
    <li>
        @Html.Raw(Resources.C1Input.MultiItem_Text3)
    </li>
    <li>
        @Html.Raw(Resources.C1Input.MultiItem_Text4)
    </li>
</ul>