New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Adaptiveness

Adaptiveness is an advanced capability that enhances the Telerik UI for ASP.NET MVC ComboBox by enabling a completely new layout based on the screen size. It also allows you to adjust the displayed on-screen keyboard for a more user-friendly interaction on touchscreen devices.

Adaptive Mode

The ComboBox supports an adaptive mode that provides a mobile-friendly rendering of its popup. To enable the adaptive rendering mode, set the AdaptiveMode() property to AdaptiveMode.Auto.

The ComboBox component automatically adapts to the current screen size and changes its rendering accordingly. On medium-sized screens, the suggestion list is displayed as docked to the bottom of the screen, while on smaller screens, it is rendered as a full-screen modal dialog. In all other scenarios, including when the AdaptiveMode() option is not specified or is set to its default value of AdaptiveMode.None, the standard popup is rendered docked to the input of the component.

The adaptive mode changes the rendering of the ComboBox popup element based on the screen resolution of the device (the horizontal value in px) with the following breakpoints:

  • Small screens—up to 500 px.
  • Medium screens—between 501 px and 768 px.
  • Large screens—over 768 px.

The following example demonstrates how to enable the adaptive mode of the ComboBox by using the AdaptiveMode() option.

    @(Html.Kendo().ComboBox()
        .Name("combobox")
        .DataTextField("ProductName")
        .DataValueField("ProductID")
        .AdaptiveMode(AdaptiveMode.Auto)
        .Filter(FilterType.StartsWith)
        .DataSource(source =>
        {
            source.Read(read =>
            {
                read.Action("Products_Read", "ComboBox");
            });
        })
    )

On-Screen Keyboard

To enhance the user experience of your application on mobile devices, you can configure the type of the on-screen keyboard for the ComboBox component.

To display an on-screen keyboard when the user focuses the ComboBox input, set the InputMode() property to any of the supported inputmode HTML attribute values. Based on the defined value, the browser displays the respective virtual keyboard on the screen.

The following example demonstrates how to configure the most appropriate on-screen keyboard for the ComboBox.

    @(Html.Kendo().ComboBox()
        .Name("combobox")
        .DataTextField("ProductName")
        .DataValueField("ProductID")
        .InputMode("search")
        .Filter(FilterType.StartsWith)
        .DataSource(source =>
        {
            source.Read(read =>
            {
                read.Action("Products_Read", "ComboBox");
            });
        })
    )

See Also

In this article