Back to Devexpress

IComboBoxSettings.ValueFieldName Property

blazor-devexpress-dot-blazor-dot-icomboboxsettings-52459e3b.md

latest2.3 KB
Original Source

IComboBoxSettings.ValueFieldName Property

Specifies the name of the data source field that contains combo box values.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue("")]
[Parameter]
string ValueFieldName { get; set; }

Property Value

TypeDefaultDescription
StringString.Empty

A field name.

|

Remarks

Use the ValueFieldName property to change the field that supplies values at runtime. To specify the field name in markup, use the DxComboBoxSettings.ValueFieldName property.

The IComboBoxSettings interface allows you to get and customize settings of a combo box editor at runtime. You can get editor settings in the following ways:

csharp
void Grid_CustomizeFilterRowEditor(GridCustomizeFilterRowEditorEventArgs e) {
    if(e.EditSettings is IComboBoxSettings comboBoxSettings)
        comboBoxSettings.ValueFieldName = "CategoryId";
}
csharp
void Grid_CustomizeDataRowEditor(GridCustomizeDataRowEditorEventArgs e) {
    if(e.EditSettings is IComboBoxSettings comboBoxSettings)
        comboBoxSettings.ValueFieldName = "CategoryId";
}

See Also

IComboBoxSettings Interface

IComboBoxSettings Members

DevExpress.Blazor Namespace