windowsforms-devexpress-dot-xtraspreadsheet-dot-customdrawcolumnheaderbackgroundeventargs.md
Returns the column index of the column header being painted.
Namespace : DevExpress.XtraSpreadsheet
Assembly : DevExpress.XtraSpreadsheet.v25.2.dll
NuGet Package : DevExpress.Win.Spreadsheet
public int ColumnIndex { get; }
Public ReadOnly Property ColumnIndex As Integer
| Type | Description |
|---|---|
| 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
// 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
' Otherwise, use Color 2.
If e.ColumnIndex <= 4 Then
Dim backColor = If(e.IsHovered OrElse (e.ColumnIndex = spreadsheetControl1.ActiveCell.ColumnIndex),
See Also
CustomDrawColumnHeaderBackgroundEventArgs Class