Back to Devexpress

WinExplorerView.CustomDrawGroupItem Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-winexplorer-dot-winexplorerview-084847de.md

latest2.7 KB
Original Source

WinExplorerView.CustomDrawGroupItem Event

Allows you to manually repaint specific WinExplorerView group captions.

Namespace : DevExpress.XtraGrid.Views.WinExplorer

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DXCategory("CustomDraw")]
public event WinExplorerViewCustomDrawGroupItemEventHandler CustomDrawGroupItem
vb
<DXCategory("CustomDraw")>
Public Event CustomDrawGroupItem As WinExplorerViewCustomDrawGroupItemEventHandler

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.

csharp
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;
}
vb
Private Sub winExplorer1_CustomDrawGroupItem(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.WinExplorer.WinExplorerViewCustomDrawGroupItemEventArgs
    e.Cache.FillRectangle(Brushes.Red, e.Bounds)
    e.DrawGroupCaption()
    e.DrawGroupCaptionButton()
    e.DrawGroupCaptionLine()
    e.Handled = True;
End Sub

See Also

WinExplorerView Class

WinExplorerView Members

DevExpress.XtraGrid.Views.WinExplorer Namespace