corelibraries-devexpress-dot-xtrapivotgrid-dot-data-dot-pivotcustomfieldvaluecellseventargsbase-dot-getcellvalue-x28-system-dot-int32-system-dot-int32-x29.md
Gets the value of a data cell by its column and row indexes.
Namespace : DevExpress.XtraPivotGrid.Data
Assembly : DevExpress.PivotGrid.v25.2.Core.dll
NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation
public object GetCellValue(
int columnIndex,
int rowIndex
)
Public Function GetCellValue(
columnIndex As Integer,
rowIndex As Integer
) As Object
| Name | Type | Description |
|---|---|---|
| columnIndex | Int32 |
An integer value that specifies the zero-based index of the column where the cell resides.
| | rowIndex | Int32 |
An integer value that specifies the zero-based index of the row where the cell resides.
|
| Type | Description |
|---|---|
| Object |
The value of the data cell with the specified column and row indexes.
|
Use the PivotCustomFieldValueCellsEventArgsBase.ColumnCount and PivotCustomFieldValueCellsEventArgsBase.RowCount properties to obtain the total number of columns and rows in the pivot grid.
Note
Cell values provided by the CustomCellValue event cannot be obtained using the GetCellValue method, because the CustomFieldValueCells event is raised prior to the CustomCellValue.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetCellValue(Int32, Int32) method.
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-pivot-grid-hide-empty-columns-and-rows/CS/Form1.cs#L42
for (int j = 0; j < e.ColumnCount ; j++) {
decimal value = Convert.ToDecimal(e.GetCellValue(j, rowIndex));
if (value != 0)
winforms-pivot-grid-hide-empty-columns-and-rows/VB/Form1.vb#L50
For j As Integer = 0 To e.ColumnCount - 1
Dim value As Decimal = Convert.ToDecimal(e.GetCellValue(j, rowIndex))
If value <> 0 Then Return False
See Also
PivotCustomFieldValueCellsEventArgsBase Class