Steps for getting started with the Input control in MVC applications:
The AutoComplete control is an auto-complete control that allows you to filter its item list as you type, as well as select a value directly from its drop-down list.
To use the AutoComplete control, you must minimally set the source-collection property to any array of data by using <c1-items-source></c1-items-source> tag in order to populate its item list. The AutoComplete control also offers several other properties to alter its behavior, such as the css-match property. The css-match property allows you to specify the CSS class that is used to highlight parts of the content that match your search terms.
The example below uses List of strings to populate the AutoComplete control's item list using the c1-item-source tag. To see a list of suggestions, type "ab" or "za" in the AutoComplete controls below.
The ComboBox control is very similar to the AutoComplete control, but rather than providing a list of suggestions as you type, the ComboBox will automatically complete and select the entry as you type.
Like the AutoComplete control, you must minimally set the source-collection property to any array of data by using <c1-items-source></c1-items-source> tag in order to populate its item list. You may also want to specify whether the ComboBox is editable via the is-editable property. The is-editable property determines whether or not a user can enter values that do not appear in the ComboBox's item list.
The example below uses two ComboBoxes bound to the same data source as the AutoComplete control above. The first ComboBox's is-editable property is set to false, while the second ComboBox's is-editable property is set to true.
The InputDate control allows you to edit and select dates via a drop-down calendar, preventing you from entering an incorrect value. The InputDate's drop-down calendar was developed as a separate control and can be used independently from the InputDate control.
Both InputDate and Calendar, specify several properties to alter the controls' behavior. The most commonly used properties include:
The example below demonstrates how to use each of these properties.
Valid Range: 1/1/2021 12:00:00 AM to 12/31/2021 12:00:00 AM
The InputDateTime control combines the InputDate and InputTime controls, allowing you to set the date and time portions. The InputDateTime control has two drop-downs: a Calendar for picking dates, and a list for picking times.
The example also shows an InputDateTime that updates both the date and time parts.
Selected Date & Time:
The ListBox control displays a list of items and allows you to select items using your mouse and keyboard. Like the AutoComplete and ComboBox controls, you must add the <c1-items-source></c1-items-source> tag to bind the source-collection property in order to use the control.
The example below allows you to select an item within the ListBox control, and also displays the control's selected-index and selected-value properties.
The InputNumber control allows you to edit numbers, preventing you from entering invalid data and optionally formatting the numeric value as it is edited. The InputNumber can be used without specifying any of its properties; however, you'll typically want to bind it to some data using the value property.
In addition to the value property, the InputNumber control offers several other properties that can be used to alter its behavior, such as:
The example below demonstrates how to use all of these properties.
The InputMask control allows you to validate and format user input as it is entered, preventing invalid data. The InputMask control can be used without specifying any of its properties; however, you will typically set its value and mask properties. Like the other MVC input controls, the value property specifies the value for the InputMask control. The mask property specifies the control's mask and supports a combination of the following characters:
The examples below demonstrates how to use the value and mask properties with the InputMask, InputDate, and InputTime controls.
The Menu control allows you to create a simple drop-down list with clickable items. The Menu's items can be defined directly or by using the <c1-items-source></c1-items-source> tag similar to the ComboBox. To specify the text displayed on the Menu, you can set the header property.
The Menu control offers two ways to handle user selections, specifying a command on each menu item and the item-clicked event. Unlike the item-clicked event, commands are objects that implement two methods:
The example below demonstrates how to use both approaches.