VGridControl.CustomDrawFilterPanel Event
Enables you to paint the Filter Panel manually.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
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
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.
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.
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);
}