Skip to main content
A newer version of this page is available. .

VGridControl.CustomDrawFilterPanel Event

Enables you to paint the Filter Panel manually.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v19.1.dll

Declaration

[DXCategory("CustomDraw")]
public event CustomDrawObjectEventHandler CustomDrawFilterPanel

Event Data

The CustomDrawFilterPanel event's data class is DevExpress.XtraVerticalGrid.Events.CustomDrawObjectEventArgs.

Remarks

The appearance of the filter panel can be customized via the VGridAppearanceCollection.FilterPanel object. Handle the CustomDrawFilterPanel event to get complete control over the panel’s painting. See the Custom Painting Basics and Custom Painting Scenarios topics for information on using custom draw events.

The CustomDrawFilterPanel event is raised before the filter panel is repainted. Handle this event to paint the panel manually or to paint additional elements on it. Information about the filter panel and its inner elements can be obtained using the Info parameter. To obtain the text for the filter conditions applied, use the control’s VGridControl.ActiveFilterString property.

If the panel has been custom painted, set the CustomDrawEventArgs.Handled parameter to true to prevent the default painting.

Important

Never change cell values or modify the control’s layout on this event, or any other event designed to tune the control’s appearance. Any action that causes a layout update can cause the control to malfunction.

Example

The following code demonstrates how to use the VGridControl.CustomDrawFilterPanel event to alter the appearance of the Vertical Grid Control’s filter panel. A 3D border is painted around the filter panel.

VGridControl_CustomDrawFilterPanel_Event

private void vGridControl1_CustomDrawFilterPanel(object sender, DevExpress.XtraVerticalGrid.Events.CustomDrawObjectEventArgs e) {
    Rectangle borderBounds = e.Bounds;
    borderBounds.Inflate(-1, -1);
    // Default painting.
    e.DefaultDraw();
    // 3D border.
    ControlPaint.DrawBorder3D(e.Graphics, borderBounds, Border3DStyle.Etched);
}
See Also