Skip to main content
A newer version of this page is available. .

VGridControlBase.GetCellValue(RowProperties, Int32) Method

Returns the value of the specified cell.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v19.1.dll

Declaration

public virtual object GetCellValue(
    RowProperties props,
    int recordIndex
)

Parameters

Name Type Description
props RowProperties

A RowProperties object that represents the row item that 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 display the total budget for the university. The total budget is represented by the TotalBudget field. The image below shows the result.

GetCellValue_props_recordIndex_SetCellValue

using DevExpress.XtraVerticalGrid;
using DevExpress.XtraVerticalGrid.Rows;
using DevExpress.XtraVerticalGrid.Events

private void vGridControl1_CellValueChanged(object sender, CellValueChangedEventArgs e) {
   double TotalBudget;
   for (int i = 0; i < vGridControl1.RecordCount; i++){
      TotalBudget = 0;
      foreach (BaseRow row in vGridControl1.Rows["budget"].ChildRows){
         for (int j = 0; j < row.RowPropertiesCount; j++){
            TotalBudget += Convert.ToDouble(row.GetRowProperties(j).Value);
         }
      }
      vGridControl1.SetCellValue(vGridControl1.Rows["Total"], i, TotalBudget);
   }
}
See Also