aspnetbootstrap-devexpress-dot-web-dot-bootstrap-ac608dae.md
Contains settings that define an individual data field providing values to a list editor.
Namespace : DevExpress.Web.Bootstrap
Assembly : DevExpress.Web.Bootstrap.v25.2.dll
NuGet Package : DevExpress.Web.Bootstrap
public class BootstrapListBoxField :
ListBoxColumn
Public Class BootstrapListBoxField
Inherits ListBoxColumn
The following members return BootstrapListBoxField objects:
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.
<dx:BootstrapComboBox ID="ComboBoxCustomFiltering" runat="server" OnCustomFiltering="ComboBoxCustomFiltering_CustomFiltering"
DataSourceID="CustomersDataSource" ValueField="CustomerID" ValueType="System.String" EnableCallbackMode="true">
<Fields>
<dx:BootstrapListBoxField FieldName="CompanyName" />
<dx:BootstrapListBoxField FieldName="Country" />
</Fields>
</dx:BootstrapComboBox>
<ef:EntityDataSource runat="server" ID="CustomersDataSource" ContextTypeName="DevExpress.Web.Demos.NorthwindContextSL" EntitySetName="Customers">
</ef:EntityDataSource>
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.
Object StateManager CollectionItem WebColumnBase ListBoxColumn BootstrapListBoxField
See Also