ComboBox
Kendo UI ComboBox component
Definition
Namespace:Kendo.Mvc.UI
Assembly:Kendo.Mvc.dll
Syntax:
public class ComboBox : WidgetBase, IHtmlAttributesContainer, IFormEditor
Inheritance: objectWidgetBaseComboBox
Implements:
Inherited Members
Constructors
Initializes a new instance of the ComboBox class.
Properties
Specifies the adaptive rendering of the component.
public AdaptiveMode? AdaptiveMode { get; set; }
Allows customization of the subtitle's text in the adaptive view of the component.
public string AdaptiveSubtitle { get; set; }
Allows customization of the title's text in the adaptive view of the component.
public string AdaptiveTitle { get; set; }
Animation member.
public PopupAnimation Animation { get; }
Controls whether to bind the widget to the data source on initialization.
public bool? AutoBind { get; set; }
If set to true, the widget automatically adjusts the width of the popup element and does not wrap up the item label.
public bool? AutoWidth { get; set; }
Use it to set the Id of the parent ComboBox widget.Help topic showing how cascading functionality works
public string CascadeFrom { get; set; }
Defines the field to be used to filter the data source. If not defined, it is set to a field with the same name as the parent's dataValueField option.Help topic showing how cascading functionality works
public string CascadeFromField { get; set; }
Defines the parent field to be used to retain value from. This value will be used further to filter the dataSource. If not defined the value from the parent's dataValueField will be used.
public string CascadeFromParentField { get; set; }
Applicable to a parent ComboBox in a cascading scenario. If set to true cascading will be triggered upon custom input in the parent widget. When set to false (default) the child will not cascade and it will be disabled upon setting custom input in the parent ComboBox. Cascade on custom values works only when cascadeFromParentField is not set for the child combo, or it points to the dataValueField of the parent.
public bool? CascadeOnCustomValue { get; set; }
Unless this options is set to false, a button will appear when hovering the widget. Clicking that button will reset the widget's value and will trigger the change event.
public bool? ClearButton { get; set; }
Gets or sets the DataSource.
public DataSource DataSource { get; }
Gets or sets the DataSourceId.
public string DataSourceId { get; set; }
The field of the data item that provides the text content of the list items. The widget will filter the data source based on this field.
public string DataTextField { get; set; }
The field of the data item that provides the value of the widget.
public string DataValueField { get; set; }
The delay in milliseconds between a keystroke and when the widget displays the popup.
public double? Delay { get; set; }
If set to false the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.
public bool? Enable { get; set; }
If set to true the widget will not show all items when the text of the search input cleared. By default the widget shows all items when the text of the search input is cleared. Works in conjunction with minLength.
public bool? EnforceMinLength { get; set; }
Sets a value controlling how the color is applied.
public FillMode? FillMode { get; set; }
The filtering method used to determine the suggestions for the current value.
public FilterType? Filter { get; set; }
The template used to render the fixed header group. By default the widget displays only the value of the current group.
public string FixedGroupTemplate { get; set; }
The handler that returns the template used for FixedGroupTemplate
public string FixedGroupTemplateHandler { get; set; }
The id of the script element used for FixedGroupTemplate
public string FixedGroupTemplateId { get; set; }
The template used to render the footer template. The footer template receives the widget itself as a part of the data argument. Use the widget fields directly in the template.
public string FooterTemplate { get; set; }
The handler that returns the template used for FooterTemplate
public string FooterTemplateHandler { get; set; }
The id of the script element used for FooterTemplate
public string FooterTemplateId { get; set; }
The template used to render the groups. By default the widget displays only the value of the group.
public string GroupTemplate { get; set; }
The handler that returns the template used for GroupTemplate
public string GroupTemplateHandler { get; set; }
The id of the script element used for GroupTemplate
public string GroupTemplateId { get; set; }
Specifies a static HTML content, which will be rendered as a header of the popup element.
public string HeaderTemplate { get; set; }
The handler that returns the template used for HeaderTemplate
public string HeaderTemplateHandler { get; set; }
The id of the script element used for HeaderTemplate
public string HeaderTemplateId { get; set; }
The height of the suggestion popup in pixels. The default value is 200 pixels.
public double? Height { get; set; }
If set to true the first suggestion will be automatically highlighted.
public bool? HighlightFirst { get; set; }
If set to false case-sensitive search will be performed to find suggestions. The widget performs case-insensitive searching by default.
public bool? IgnoreCase { get; set; }
Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.
public string InputMode { get; set; }
Adds a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.
public ComboBoxLabelSettings Label { get; }
The text messages displayed in the widget. Use this option to customize or localize the messages.
public ComboBoxMessagesSettings Messages { get; }
The minimum number of characters the user must type before a search is performed. Set to higher value than 1 if the search could match a lot of items.
public double? MinLength { get; set; }
The template used to render the "no data" template, which will be displayed if no results are found or the underlying data source is empty. The noData template receives the widget itself as a part of the data argument. The template will be evaluated on every widget data bound.
public string NoDataTemplate { get; set; }
The handler that returns the template used for NoDataTemplate
public string NoDataTemplateHandler { get; set; }
The id of the script element used for NoDataTemplate
public string NoDataTemplateId { get; set; }
The hint displayed by the widget when it is empty. Not set by default.
public string Placeholder { get; set; }
The options that will be used for the popup initialization. For more details about the available options refer to Popup documentation.
public ComboBoxPopupSettings Popup { get; }
The configuration for the prefix adornment of the component.
public ComboBoxPrefixOptionsSettings PrefixOptions { get; }
If set to true, the widget will be readonly and will not allow user input. The widget is not readonly be default and allow user input.
public bool? Readonly { get; set; }
SelectedIndex member.
public int? SelectedIndex { get; set; }
Sets the size of the component.
public ComponentSize? Size { get; set; }
The configuration for the suffix adornment of the component.
public ComboBoxSuffixOptionsSettings SuffixOptions { get; }
If set to true the widget will automatically use the first suggestion as its value.
public bool? Suggest { get; set; }
When set to true the widget will automatically set selected value to the typed custom text. Set the option to false to clear the selected value but keep the custom text.
public bool? SyncValueAndText { get; set; }
The template used to render the items. By default the widget displays only the text of the data item (configured via dataTextField).
public string Template { get; set; }
The handler that returns the template used for Template
public string TemplateHandler { get; set; }
The id of the script element used for Template
public string TemplateId { get; set; }
The text of the widget used when the autoBind is set to false.
public string Text { get; set; }
Specifies the value binding behavior for the widget when the initial model value is null. If set to true, the View-Model field will be updated with the selected item value field. If set to false, the View-Model field will be updated with the selected item.
public bool? ValuePrimitive { get; set; }
Enables the virtualization feature of the widget. The configuration can be set on an object, which contains two properties - itemHeight and valueMapper.For detailed information, refer to the article on virtualization.
public ComboBoxVirtualSettings Virtual { get; }
Methods
GetElement method.
Serializes the component settings to a dictionary.
public override IDictionary<string, object> Serialize()
A dictionary of settings.
Overrides:
Implements:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML content.
protected override void WriteHtml(TextWriter writer)
The text writer.
Overrides:
WriteInitializationScript method.
public override void WriteInitializationScript(TextWriter writer)
Overrides: