windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-rowcellcustomdraweventargs.md
Gets the column whose element is being painted.
Namespace : DevExpress.XtraGrid.Views.Base
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public GridColumn Column { get; }
Public ReadOnly Property Column As GridColumn
| Type | Description |
|---|---|
| GridColumn |
A GridColumn object (or descendant) representing the column whose data cell is being painted. null ( Nothing in Visual Basic) if the painted element has no corresponding column.
|
The property returns null ( Nothing in Visual Basic) when handling the CardView.CustomDrawCardCaption event. In other cases, the property returns the column whose data cell is being painted.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Column 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-show-error-icons/CS/Form1.cs#L59
BaseEditViewInfo info = ((GridCellInfo)e.Cell).ViewInfo;
string error = GetError(e.CellValue, e.RowHandle, e.Column);
SetError(info, error);
winforms-grid-move-cell-using-drag-drop/CS/Classes/GridViewHelper.cs#L63
if (lastMouseDownMoveCell == null || sourceGridCell == null) return;
if (e.RowHandle == lastMouseDownMoveCell.RowHandle && e.Column == lastMouseDownMoveCell.Column)
e.Cache.DrawRectangle(e.Cache.GetPen(Color.Gray), new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height));
winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/CS/CarsGridWinApp15/Main.cs#L30
string filterCellText = view.GetRowCellDisplayText(GridControl.AutoFilterRowHandle, e.Column);
if ( String.IsNullOrEmpty(filterCellText) )
winforms-grid-richedit-highlight-search-results/CS/E4422/Form1.cs#L19
private void OnCustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) {
if (e.Column == colDescription && !string.IsNullOrEmpty(gridView1.FindFilterText)) {
server.RtfText = e.DisplayText;
winforms-grid-draw-thick-border-abound-focused-cell/CS/Form1.cs#L16
GridView view = sender as GridView;
if (e.Column == view.FocusedColumn && e.RowHandle == view.FocusedRowHandle) {
e.DefaultDraw();
winforms-grid-show-error-icons/VB/Form1.vb#L67
Dim info As BaseEditViewInfo = CType(e.Cell, GridCellInfo).ViewInfo
Dim [error] As String = GetError(e.CellValue, e.RowHandle, e.Column)
SetError(info, [error])
winforms-grid-move-cell-using-drag-drop/VB/Classes/GridViewHelper.vb#L60
End If
If e.RowHandle = lastMouseDownMoveCell.RowHandle AndAlso e.Column Is lastMouseDownMoveCell.Column Then
e.Cache.DrawRectangle(e.Cache.GetPen(Color.Gray), New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height))
winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/VB/CarsGridWinApp15/Main.vb#L24
If Not view.OptionsView.ShowAutoFilterRow OrElse Not view.IsDataRow(e.RowHandle) Then Return
Dim filterCellText As String = view.GetRowCellDisplayText(GridControl.AutoFilterRowHandle, e.Column)
If String.IsNullOrEmpty(filterCellText) Then Return
winforms-grid-richedit-highlight-search-results/VB/E4422/Form1.vb#L22
Private Sub OnCustomDrawCell(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs)
If e.Column Is colDescription AndAlso Not String.IsNullOrEmpty(gridView1.FindFilterText) Then
server.RtfText = e.DisplayText
winforms-grid-draw-thick-border-abound-focused-cell/VB/Form1.vb#L21
Dim view As GridView = TryCast(sender, GridView)
If e.Column Is view.FocusedColumn AndAlso e.RowHandle = view.FocusedRowHandle Then
e.DefaultDraw()
See Also
RowCellCustomDrawEventArgs Class