Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WinExplorerView.CustomDrawGroupItem Event

Allows you to manually repaint specific WinExplorerView group captions.

Namespace: DevExpress.XtraGrid.Views.WinExplorer

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

[DXCategory("CustomDraw")]
public event WinExplorerViewCustomDrawGroupItemEventHandler CustomDrawGroupItem

#Event Data

The CustomDrawGroupItem event's data class is DevExpress.XtraGrid.Views.WinExplorer.WinExplorerViewCustomDrawGroupItemEventArgs.

#Remarks

The WinExplorerView groups its items according to the WinExplorerViewColumns.GroupColumn property. Handle the CustomDrawGroupItem event to re-paint individual WinExplorerView group captions.

The code sample below paints group items’ backgrounds with a solid red brush.

private void winExplorer1_CustomDrawGroupItem(object sender, DevExpress.XtraGrid.Views.WinExplorer.WinExplorerViewCustomDrawGroupItemEventArgs e) {
    e.Cache.FillRectangle(Brushes.Red, e.Bounds);
    e.DrawGroupCaption();
    e.DrawGroupCaptionButton();
    e.DrawGroupCaptionLine();
    e.Handled = true;
}
See Also