VGridControlBase.GetCellValue(BaseRow, Int32) Method
Returns the value of the specified cell.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v19.1.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
row | BaseRow | A BaseRow descendant that represents the row which owns the cell. |
recordIndex | Int32 | A zero-based integer that specifies the index of the record which contains the cell. |
Returns
Type | Description |
---|---|
Object | An object that represents the cell’s value. null (Nothing in Visual Basic) if no cell is found. |
Remarks
For more information, see Obtaining and Setting Cell Values.
Example
The following sample code handles the VGridControlBase.CellValueChanged event to change the processed row’s style if its summary data cells value is greater than 100,000. The VGridControlBase.GetCellValue method is used for this purpose.
The image below shows the result.
using DevExpress.Utils;
using DevExpress.XtraVerticalGrid;
using DevExpress.XtraVerticalGrid.Rows;
using DevExpress.XtraVerticalGrid.Events;
private void vGridControl1_CellValueChanged(object sender, CellValueChangedEventArgs e) {
double sum = 0;
for (int i = 0; i < vGridControl1.RecordCount; i++)
sum += Convert.ToDouble(vGridControl1.GetCellValue(e.Row, i));
if (sum > 100000)
e.Row.Appearance.BackColor = Color.Red;
else
e.Row.Appearance.Options.UseBackColor = false;
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetCellValue(BaseRow, 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.