Back to Devexpress

AutoCompleteBoxPropertiesBase.IncrementalFilteringMode Property

aspnet-devexpress-dot-web-dot-autocompleteboxpropertiesbase-7a0d73c1.md

latest6.1 KB
Original Source

AutoCompleteBoxPropertiesBase.IncrementalFilteringMode Property

Gets or sets a value that specifies the filtering mode of the editor.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(IncrementalFilteringMode.Contains)]
public virtual IncrementalFilteringMode IncrementalFilteringMode { get; set; }
vb
<DefaultValue(IncrementalFilteringMode.Contains)>
Public Overridable Property IncrementalFilteringMode As IncrementalFilteringMode

Property Value

TypeDefaultDescription
IncrementalFilteringModeContains

One of the IncrementalFilteringMode enumeration values.

|

Available values:

NameDescription
Contains

The editor filters items that contain the filter string.

| | StartsWith |

The editor filters items that begin with the filter string.

| | None |

The editor does not filter items.

|

Remarks

The editor allows its items to be filtered in a drop down window by the text typed in the editor’s input box. Use the IncrementalFilteringMode property to specify the editor’s filter mode.

When callbacks are enabled (e.g., by setting the AutoCompleteBoxPropertiesBase.EnableCallbackMode property to true), the incremental filtering feature functions via callbacks to the server.

Note

The IncrementalFilteringMode property synchronizes its value with the editor’s ASPxAutoCompleteBoxBase.IncrementalFilteringMode property.

Example

Web Forms approach:

Note

For a full example, see the ASPxComboBox - Cascading Combo Boxes demo.

aspx
<dx:ASPxComboBox runat="server" ID="CmbCountry" DropDownStyle="DropDownList" IncrementalFilteringMode="StartsWith"
    TextField="CountryName" ValueField="CountryName" Width="100%" DataSourceID="CountriesDataSource"
    EnableSynchronization="False">
    <ClientSideEvents SelectedIndexChanged="function(s, e) { OnCountryChanged(s); }" />
</dx:ASPxComboBox>
javascript
var lastCountry = null;
function OnCountryChanged(cmbCountry) {
    if (cmbCity.InCallback())
        lastCountry = cmbCountry.GetValue().toString();
    else
        cmbCity.PerformCallback(cmbCountry.GetValue().toString());
    }
function OnEndCallback(s, e) {
    if (lastCountry) {
        cmbCity.PerformCallback(lastCountry);
        lastCountry = null;
    }
}

MVC approach (Token Box):

cshtml
@Html.DevExpress().TokenBox(settings =>
{
    settings.Name = "tokenBox1";

    settings.Properties.TextField = "Name";
    settings.Properties.ValueField = "Email";

    settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
    settings.Properties.IncrementalFilteringDelay = 500;
}).BindList(Model).GetHtml()

The image below illustrates the results.

The following code snippets (auto-collected from DevExpress Examples) contain references to the IncrementalFilteringMode property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-mvc-grid-cascading-combo-boxes-in-batch-edit-mode/CS/Models/ComboBoxPropertiesProvider.cs#L75

csharp
cs.IncrementalFilteringDelay = 1000;
cs.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
cs.FilterMinLength = 2;

asp-net-mvc-grid-cascading-combo-boxes-in-edit-form/CS/Models/ComboBoxPropertiesProvider.cs#L75

csharp
cs.IncrementalFilteringDelay = 1000;
cs.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
cs.FilterMinLength = 2;

asp-net-mvc-grid-cascading-combo-boxes-in-batch-edit-mode/VB/Models/ComboBoxPropertiesProvider.vb#L68

vb
cs.IncrementalFilteringDelay = 1000
cs.IncrementalFilteringMode = IncrementalFilteringMode.Contains
cs.FilterMinLength = 2

asp-net-mvc-grid-cascading-combo-boxes-in-edit-form/VB/Models/ComboBoxPropertiesProvider.vb#L68

vb
cs.IncrementalFilteringDelay = 1000
cs.IncrementalFilteringMode = IncrementalFilteringMode.Contains
cs.FilterMinLength = 2

See Also

AutoCompleteBoxPropertiesBase Class

AutoCompleteBoxPropertiesBase Members

DevExpress.Web Namespace