Back to Devexpress

CustomRowCellEventArgs.Column Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customrowcelleventargs-c0edc95e.md

latest4.6 KB
Original Source

CustomRowCellEventArgs.Column Property

Gets the column to which the currently processed cell corresponds.

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 (descendant) representing the column that 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-highlight-modified-cells/CS/Form1.cs#L32

csharp
void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) {
    if (CellExists(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column)) {
        e.Appearance.BackColor = Color.ForestGreen;

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

csharp
{
    Color color = GetCellColor(new MyGridCell(e.RowHandle, e.Column));
    if (color.IsEmpty)

winforms-grid-display-colored-progress-bars/CS/ColoredProgressBar/DifferentRepositoriesProgressBar.cs#L57

csharp
private void View_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e) {
    if (e.Column == _Column) {
        int percent = Convert.ToInt16(e.CellValue);

winforms-grid-highlight-modified-cells/VB/Form1.vb#L34

vb
Private Sub gridView1_RowCellStyle(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs)
    If CellExists(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column) Then
        e.Appearance.BackColor = Color.ForestGreen

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

vb
Private Sub _View_RowCellStyle(ByVal sender As Object, ByVal e As RowCellStyleEventArgs)
    Dim color As Color = GetCellColor(New MyGridCell(e.RowHandle, e.Column))
    If color.IsEmpty Then Return

winforms-grid-display-colored-progress-bars/VB/ColoredProgressBar/DifferentRepositoriesProgressBar.vb#L62

vb
Private Sub View_CustomRowCellEdit(ByVal sender As Object, ByVal e As CustomRowCellEditEventArgs)
    If e.Column Is _Column Then
        Dim percent As Integer = Convert.ToInt16(e.CellValue)

See Also

RowHandle

CustomRowCellEventArgs Class

CustomRowCellEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace