FilterControl.InitNode Event
Allows you to customize a node’s settings when it is initialized.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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. |
The event data class exposes the following methods:
Method | Description |
---|---|
SetOperation(FunctionOperatorType) | Sets the operation type for the current node. |
SetOperation(ClauseType) | Sets the operation type for the current node. |
SetOperation(String) | Applies a registered custom function to the current node. |
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