VGridControlBase.GetCellValue(BaseRow, Int32) Method

Returns the value of the specified cell.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v20.1.dll

Declaration

public virtual object GetCellValue(
    BaseRow row,
    int recordIndex
)
Public Overridable Function GetCellValue(
    row As BaseRow,
    recordIndex As Integer
) As Object

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.

Examples

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.

GetCellValue rowHandle recordIndex - method

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;
}
See Also