Skip to main content

BootstrapListBoxField Class

Contains settings that define an individual data field providing values to a list editor.

Namespace: DevExpress.Web.Bootstrap

Assembly: DevExpress.Web.Bootstrap.v24.2.dll

NuGet Package: DevExpress.Web.Bootstrap

#Declaration

public class BootstrapListBoxField :
    ListBoxColumn

#Remarks

A single item of a list editor can display values obtained from several data fields. By default, the displayed values are separated by a semicolon. This functionality is used by list editors such as the BootstrapComboBox and BootstrapListBox.

Fields are stored in a collection of the BootstrapListBoxFieldCollection type, which can be accessed using the list editor’s Fields property. An individual field can be accessed within the collection using indexer notation. A field can be mapped to a data source’s column using the ListBoxColumn.FieldName property.

protected void ComboBoxCustomFiltering_CustomFiltering(object sender, ListEditCustomFilteringEventArgs e) {
    string[] words = e.Filter.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    string[] dataFields = new string[] { "CompanyName", "Country" };
    e.FilterExpression = DevExpress.Data.Filtering.GroupOperator.And(words.Select(w =>
        DevExpress.Data.Filtering.GroupOperator.Or(
            dataFields.Select(f =>
                new DevExpress.Data.Filtering.FunctionOperator(DevExpress.Data.Filtering.FunctionOperatorType.Contains, new DevExpress.Data.Filtering.OperandProperty(f), w)
            )
        )
    )).ToString();
    e.CustomHighlighting = dataFields.ToDictionary(f => f, f => words);
}

Note

The Custom Filtering online demo shows the result of the code executed above.

See Also