MultiColumnComboBox HtmlHelper Overview

The Telerik UI MultiColumnComboBox HtmlHelper for ASP.NET Core is a server-side wrapper for the Kendo UI MultiColumnComboBox widget.

The MultiColumnComboBox visualizes huge sets of data in a grid-like table.

Initializing the MultiColumnComboBox

The following example demonstrates how to define the MultiColumnComboBox HtmlHelper.

    @(Html.Kendo().MultiColumnComboBox()
        .Name("multicolumncombobox")
        .Placeholder("Select product")
        .DataTextField("ProductName")
        .DataValueField("ProductID")
        .Columns(columns =>
        {
            columns.Add().Field("ProductName").Title("Product Name").Width("200px")
            columns.Add().Field("ProductID").Title("Product ID").Width("200px");
        })
        .Filter(FilterType.StartsWith)
        .DataSource(source => {
            source.Read(read =>
            {
                read.Action("Products_Read", "MultiColumnComboBox");
            })
            .ServerFiltering(true);
        })
    )


    public class MultiColumnComboBoxController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }

        public JsonResult Products_Read(string text)
        {
            var result = GetProducts();

            if (!string.IsNullOrEmpty(text))
            {
                result = result.Where(p => p.ProductName.Contains(text)).ToList();
            }

            return Json(result);
        }

        private static IEnumerable<ProductViewModel> GetProducts()
        {
            var result = Enumerable.Range(0, 50).Select(i => new ProductViewModel
            {
                ProductID = "" + i,
                ProductName = "Product " + i
            });

            return result;
        }
    }

Basic Configuration

The following example demonstrates the basic configuration of the MultiColumnComboBox HtmlHelper.

@(Html.Kendo().MultiColumnComboBox()
    .Name("multicolumncombobox")
    .Placeholder("Select product")
    .DataTextField("ProductName")
    .DataValueField("ProductID")
    .Columns(columns =>
    {
        columns.Add().Field("ProductName").Title("Product Name").Width("200px")
        columns.Add().Field("ProductID").Title("Product ID").Width("200px");
    })
    .HtmlAttributes(new { style = "width:100%;" })
    .Filter("contains")
    .AutoBind(true)
    .MinLength(3)
    .Height(400)
    .DataSource(source => source
        .Read(read => read.Action("Products_Read", "MultiColumnComboBox"))
        .ServerFiltering(true)
    )
)

Functionality and Features

Events

For a complete example on basic MultiColumnComboBox events, refer to the demo on using the events of the MultiColumnComboBox.

Referencing Existing Instances

To reference an existing MultiColumnComboBox instance, use the jQuery.data() configuration option. Once a reference is established, use the MultiColumnComboBox API to control its behavior.

    // Place the following after your Telerik UI MultiColumnComboBox for ASP.NET Core declaration.
    <script>
        $(document).ready(function() {
            // The Name() of the MultiColumnComboBox is used to get its client-side instance.
            var mccombobox = $("#multicolumncombobox").data("kendoMultiColumnComboBox");
        });
    </script>

See Also

In this article
Not finding the help you need? Improve this article