windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customdraweventargs-8ba3605f.md
Gets or sets a value specifying whether an event was handled and that the default element painting is therefore not required.
Namespace : DevExpress.XtraGrid.Views.Base
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public bool Handled { get; set; }
Public Property Handled As Boolean
| Type | Description |
|---|---|
| Boolean |
true if the default element painting is not required; otherwise, false.
|
If custom drawing is implemented and the Handled property value remains set to false , all the custom drawing performed will be overwritten by the default painting mechanism using the appearance settings. These appearance settings are specified by the CustomDrawEventArgs.Appearance property.
Set the Handled property to true to prevent the default painting mechanism from clearing any custom drawing after a custom draw event handler has been completed.
The CustomDrawEventArgs.DefaultDraw method, when called, automatically sets the Handled property to true.
The CustomDrawEventArgs.DefaultDraw method does nothing if the Handled property has already been set to true.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Handled property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-print-custom-draw-content/CS/MyXtraGrid/MyGridView/MyGridView.cs#L29
FooterCellCustomDrawEventArgs args = new FooterCellCustomDrawEventArgs(cache, -1, col, null, styleArgs);
args.Handled = true;
RaiseCustomDrawFooterCell(args);
winforms-grid-multiple-row-selection-web-style-checkboxes/CS/E1271/CheckMarkSelection.cs#L234
DrawCheckBox(e.Cache, e.Bounds, SelectedCount == _view.DataRowCount);
e.Handled = true;
}
DrawGroupEditor(e);
e.Handled = true;
}
winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/CS/CarsGridWinApp15/Main.cs#L39
e.Cache.Paint.DrawMultiColorString(e.Cache, e.Bounds, e.DisplayText, filterCellText, e.Appearance, Color.Black, Color.Gold, false, filterTextIndex);
e.Handled = true;
}
winforms-grid-keep-groups-expanded/CS/KeepGroupsExpanded/Form1.cs#L31
ObjectPainter.DrawObject(e.Cache, e.Painter, e.Info);
e.Handled = true;
}
winforms-grid-print-custom-draw-content/VB/MyXtraGrid/Form1.vb#L33
Private Sub myGridView1_CustomDrawFooterCell(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs) Handles myGridView1.CustomDrawFooterCell
Dim isPrinting As Boolean = e.Handled
e.Handled = True
winforms-grid-multiple-row-selection-web-style-checkboxes/VB/E1271/CheckMarkSelection.vb#L274
DrawCheckBox(e.Cache, e.Bounds, SelectedCount = _view.DataRowCount)
e.Handled = True
End If
DrawGroupEditor(e)
e.Handled = True
End If
winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/VB/CarsGridWinApp15/Main.vb#L30
e.Cache.Paint.DrawMultiColorString(e.Cache, e.Bounds, e.DisplayText, filterCellText, e.Appearance, Color.Black, Color.Gold, False, filterTextIndex)
e.Handled = True
End Sub
winforms-grid-keep-groups-expanded/VB/KeepGroupsExpanded/Form1.vb#L33
ObjectPainter.DrawObject(e.Cache, e.Painter, e.Info)
e.Handled = True
End Sub
See Also