Skip to content

Commit e579241

Browse files
jivanovamarin-bratanov
authored andcommitted
chore(combobox): update overview article
1 parent e1b676f commit e579241

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

components/combobox/overview.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Selected value: @selectedValue
3434
IEnumerable<MyDdlModel> myComboData = Enumerable.Range(1, 20).Select(x => new MyDdlModel { MyTextField = "item " + x, MyValueField = x });
3535
3636
int selectedValue { get; set; } = 3; //usually the current value should come from the model data
37-
37+
3838
//in a real case, the model is usually in a separate file
3939
//the model type and value field type must be provided to the dropdpownlist
4040
public class MyDdlModel
@@ -67,8 +67,8 @@ The ComboBox is a generic component and its type is determined by the type of th
6767
* `TValue` - the type of the value field from the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
6868
* `TextField` - the name of the field from the model that will be shown to the user. Defaults to `Text`.
6969
* `ValueField` - the name of the field from the model that will be the underlying `value`. Defaults to `Value`.
70-
* `Value` and `bind-Value`- get/set the value of the component, can be used for binding. If you set it to a value allowed by the model class value field, the corresponding item from the data collection will be pre-selected. Use the `bind-Value` syntax for two-way binding, for example, to a variable of your own.
71-
70+
* `Value` and `bind-Value`- get/set the value of the component, can be used for binding. If you set it to a value allowed by the model class value field, the corresponding item from the data collection will be pre-selected. Use the `bind-Value` syntax for two-way binding, for example, to a variable of your own.
71+
7272
The `Value` and `ValueField` can be of types:
7373

7474
* `number` (such as `int`, `double` and so on)
@@ -82,13 +82,13 @@ The ComboBox is a generic component and its type is determined by the type of th
8282

8383
## Selected Item
8484

85-
By default, if no `Value` is provided, the first item from the data source will be selected. If a `Value` is provided, the first item from the data source whose `ValueField` matches will be selected.
85+
By default, if no `Value` is provided, the ComboBox will appear empty, or will display the `Placeholder` defined.If a Value is provided, the first item from the data source whose ValueField matches will be selected.
8686

8787
The ComboBox will not always have a selected item, however, because it can act as an input. There will be no selected item in the following cases that depend on the settings of the component that the developer can control:
8888

89-
* the initial `Value` is not present in the data source,
9089
* the user clears the value through the Clear button,
91-
* `AllowCustom="true"` - only initial selection is possible, through the `Value` parameter and user actions remove it (see the table below).
90+
* the user clears the value with `Backspace` or `Del` keys,
91+
* `AllowCustom="false"` - ComboBox's input value will be automatically cleared on change event (`blur` or `Enter`) (see the table below).
9292

9393

9494
Missing selection is most common when the initial value is `null` as data sources rarely have items with a `null` value, and/or when you want to let your users type in values that are not in your predefined set of options.
@@ -98,8 +98,8 @@ If the user types text in the input, selection behaves according to the followin
9898

9999
| User input matches an item | AllowCustom=`true` | AllowCustom=`false` |
100100
|----------------------------|----------------------|------------------------------------------|
101-
| Yes | No item is selected. | Matching item is selected. |
102-
| No | No item is selected. | If there was no previous selection, no item is selected. If there was previous selection, the previously selected item is selected. The `OnChange` event does not fire. |
101+
| Yes | Matched item is selected. | Matching item is selected. |
102+
| No | No item is selected. `Value` is updated to the custom one | No item is selected. `Value` is updated to the `default(typeof(Value))`. The `OnChange` event does not fire for the value clearing. |
103103

104104

105105

@@ -108,4 +108,4 @@ If the user types text in the input, selection behaves according to the followin
108108
* [Data Binding]({%slug components/combobox/databind%})
109109
* [Live Demo: ComboBox](https://demos.telerik.com/blazor-ui/combobox/overview)
110110
* [Live Demo: ComboBox Validation](https://demos.telerik.com/blazor-ui/combobox/validation)
111-
111+

0 commit comments

Comments
 (0)