Back to Devexpress

RowCellCustomDrawEventArgs.CellValue Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-rowcellcustomdraweventargs-4b83801b.md

latest5.1 KB
Original Source

RowCellCustomDrawEventArgs.CellValue Property

Gets the painted value or display text (depending on the event).

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
public object CellValue { get; set; }
vb
Public Property CellValue As Object

Property Value

TypeDescription
Object

An object representing the painted cell’s value.

|

Remarks

The CellValue property returns different values for different events:

|

Event(s)

|

CellValue content

| | --- | --- | |

GridView.CustomDrawCell

CardView.CustomDrawCardFieldValue

LayoutView.CustomDrawCardFieldValue

|

The field value.

Note

To get the field value converted to a string based on the column value display format, use the RowCellCustomDrawEventArgs.DisplayText property.

| |

CardView.CustomDrawCardField

|

A string that specifies the field value converted to text using the column value display format.

Note

The column value display format can be specified with the GridColumn.DisplayFormat property.

| |

CardView.CustomDrawCardFieldCaption

LayoutView.CustomDrawCardFieldCaption

|

A string value that specifies the field caption.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the CellValue 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-display-colored-progress-bars/CS/ColoredProgressBar/CustomPaintedProgressBarHelper.cs#L23

csharp
void DrawProgressBar(DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) {
    int percent = Convert.ToInt16(e.CellValue);
    int v = Convert.ToInt32(e.CellValue);

winforms-grid-show-error-icons/CS/Form1.cs#L59

csharp
BaseEditViewInfo info = ((GridCellInfo)e.Cell).ViewInfo;
string error = GetError(e.CellValue, e.RowHandle, e.Column);
SetError(info, error);

winforms-grid-display-colored-progress-bars/VB/ColoredProgressBar/CustomPaintedProgressBarHelper.vb#L29

vb
Private Sub DrawProgressBar(ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs)
    Dim percent As Integer = Convert.ToInt16(e.CellValue)
    Dim v As Integer = Convert.ToInt32(e.CellValue)

winforms-grid-show-error-icons/VB/Form1.vb#L67

vb
Dim info As BaseEditViewInfo = CType(e.Cell, GridCellInfo).ViewInfo
Dim [error] As String = GetError(e.CellValue, e.RowHandle, e.Column)
SetError(info, [error])

See Also

CustomDrawCell

DisplayText

RowCellCustomDrawEventArgs Class

RowCellCustomDrawEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace