Back to Devexpress

CustomDrawColumnHeaderBackgroundEventArgs.ColumnIndex Property

windowsforms-devexpress-dot-xtraspreadsheet-dot-customdrawcolumnheaderbackgroundeventargs.md

latest2.6 KB
Original Source

CustomDrawColumnHeaderBackgroundEventArgs.ColumnIndex Property

Returns the column index of the column header being painted.

Namespace : DevExpress.XtraSpreadsheet

Assembly : DevExpress.XtraSpreadsheet.v25.2.dll

NuGet Package : DevExpress.Win.Spreadsheet

Declaration

csharp
public int ColumnIndex { get; }
vb
Public ReadOnly Property ColumnIndex As Integer

Property Value

TypeDescription
Int32

An integer that is the zero-based worksheet column index.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ColumnIndex 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-spreadsheet-custom-draw-example/CS/WindowsFormsApp1/Form1.cs#L171

csharp
// Otherwise, use Color 2.
if (e.ColumnIndex <= 4) {
    var backColor = e.IsHovered || (e.ColumnIndex == spreadsheetControl1.ActiveCell.ColumnIndex) ?

winforms-spreadsheet-custom-draw-example/VB/CustomDrawExample/Form1.vb#L66

vb
' Otherwise, use Color 2.
If e.ColumnIndex <= 4 Then
    Dim backColor = If(e.IsHovered OrElse (e.ColumnIndex = spreadsheetControl1.ActiveCell.ColumnIndex),

See Also

CustomDrawColumnHeaderBackgroundEventArgs Class

CustomDrawColumnHeaderBackgroundEventArgs Members

DevExpress.XtraSpreadsheet Namespace