VGridControl.CustomDrawFilterPanel Event

Enables you to paint the Filter Panel manually.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v20.1.dll

Declaration

[DXCategory("CustomDraw")]
public event CustomDrawObjectEventHandler CustomDrawFilterPanel
<DXCategory("CustomDraw")>
Public Event CustomDrawFilterPanel As CustomDrawObjectEventHandler

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

Do not change cell values, modify the control's layout, or change the control's object model in the events used for custom control painting. Actions that update the layout can cause the control to malfunction.

Examples

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