Skip to main content
Tab

ASPxGridBase.FilterControlCriteriaValueEditorCreate Event

Allows you to replace the default criteria value editor with a custom editor.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public event FilterControlCriteriaValueEditorCreateEventHandler FilterControlCriteriaValueEditorCreate

Event Data

The FilterControlCriteriaValueEditorCreate event's data class is FilterControlCriteriaValueEditorCreateEventArgs. The following properties provide information specific to this event:

Property Description
Column Gets the column whose editor is being created.
EditorProperties Gets or sets the processed editor properties.
Value Gets or sets the processed editor value.

Remarks

The FilterControlCriteriaValueEditorCreate event fires for an editor in the criteria value, and enables you to replace the default editor with a custom editor.

To change the editor, use the event parameter’s EditorProperties property. The editor’s value is specified by the Value property.

protected void grid_FilterControlCriteriaValueEditorCreate(object sender, FilterControlCriteriaValueEditorCreateEventArgs e) {
    if(e.Column.PropertyName == "NeedAlert") {
        e.EditorProperties = CreateComboBoxProperties(e.Value);
    }
}
EditPropertiesBase CreateComboBoxProperties(object value) {
    bool v = value != null && (bool)value;
    var props = new ComboBoxProperties();
    props.ValueType = typeof(bool);
    props.Items.Add(new ListEditItem("Need alert", true) { Selected = v });
    props.Items.Add(new ListEditItem("Is's ok", false) { Selected = !v });
    return props;
}

Run Demo: Grid - Filter Control Run Demo: Card View - Filter Control Run Demo: Vertical Grid - Filter Control

See Also