FilterControl.InitNode Event

Allows you to customize a node's settings when it is initialized.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[DXCategory("Events")]
public event InitNodeEventHandler InitNode
<DXCategory("Events")>
Public Event InitNode As InitNodeEventHandler

Event Data

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

Property Description
IsNewNode Gets whether the node is newly created.
PropertyName Gets or sets the property (field) name.
PropertyType Gets the type of the current property (column/field). Inherited from BaseNodeEventArgs.

Remarks

The InitNode event fires in the following cases:

  • You add a new node in the Filter Control. In this case, the IsNewNode event parameter returns true.
  • You change the property (field) name for an existing node (via a dropdown list). In this case, the IsNewNode event parameter returns false.

To change the operation type for the current node, use the SetOperation method (available from the event arguments).

Example

The following example sets the default operation type to GreaterOrEqual for the UnitPrice field.

private void filterControl1_InitNode(object sender, DevExpress.XtraEditors.Filtering.InitNodeEventArgs e) {
    if (e.PropertyName == "UnitPrice")
        e.SetOperation(DevExpress.Data.Filtering.Helpers.ClauseType.GreaterOrEqual);
}
See Also