Back to Devexpress

GridCell.Column Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-gridcell.md

latest5.6 KB
Original Source

GridCell.Column Property

Gets the column which contains the cell.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
public GridColumn Column { get; }
vb
Public ReadOnly Property Column As GridColumn

Property Value

TypeDescription
GridColumn

A GridColumn object that represents the column which contains the cell.

|

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-move-cell-using-drag-drop/CS/Classes/GridViewHelper.cs#L53

csharp
sourceGridCell = new GridCell(gridHI.RowHandle, gridHI.Column);
    lastMouseDownMoveCell = new GridCell(sourceGridCell.RowHandle, sourceGridCell.Column);
}

winforms-grid-copy-cell-value-to-other-cells-by-dragging-its-right-bottom-edge/CS/Classes/DragCellsValuesHelper.cs#L83

csharp
{
    object value = View.GetRowCellValue(SourceGridCell.RowHandle, SourceGridCell.Column);
    GridCell[] selectedCells = View.GetSelectedCells();

winforms-grid-customize-cell-color/CS/CellColorHelper.cs#L51

csharp
colors[cell] = value;
    _View.RefreshRowCell(cell.RowHandle, cell.Column);
}

winforms-grid-multi-cell-editing/CS/MultiSelectionEditingHelper.cs#L64

csharp
int rowHandle = cell.RowHandle;
GridColumn column = cell.Column;
switch(mode) {

winforms-grid-draw-thick-cell-border-directx/CS/Form1.cs#L72

csharp
GridViewInfo info = _View.GetViewInfo() as GridViewInfo;
GridCellInfo cellInfo = info.GetGridCellInfo(cell.RowHandle, cell.Column);
return cellInfo.Bounds;

winforms-grid-move-cell-using-drag-drop/VB/Classes/GridViewHelper.vb#L49

vb
sourceGridCell = New GridCell(gridHI.RowHandle, gridHI.Column)
    lastMouseDownMoveCell = New GridCell(sourceGridCell.RowHandle, sourceGridCell.Column)
End If

winforms-grid-copy-cell-value-to-other-cells-by-dragging-its-right-bottom-edge/VB/Classes/DragCellsValuesHelper.vb#L80

vb
Private Sub CopyCellsValues()
    Dim value As Object = View.GetRowCellValue(SourceGridCell.RowHandle, SourceGridCell.Column)
    Dim selectedCells() As GridCell = View.GetSelectedCells()

winforms-grid-customize-cell-color/VB/CellColorHelper.vb#L42

vb
colors(cell) = value
    _View.RefreshRowCell(cell.RowHandle, cell.Column)
End Sub

winforms-grid-multi-cell-editing/VB/MultiSelectionEditingHelper.vb#L57

vb
Dim rowHandle As Integer = cell.RowHandle
Dim column As GridColumn = cell.Column
Select Case mode

winforms-grid-draw-thick-cell-border-directx/VB/Form1.vb#L68

vb
Dim info As GridViewInfo = TryCast(_View.GetViewInfo(), GridViewInfo)
Dim cellInfo As GridCellInfo = info.GetGridCellInfo(cell.RowHandle, cell.Column)
Return cellInfo.Bounds

See Also

RowHandle

GridCell Class

GridCell Members

DevExpress.XtraGrid.Views.Base Namespace