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

VGridControlBase.CellValueChanged Event

Fires immediately after a cell’s value has been changed.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v18.2.dll

Declaration

public event CellValueChangedEventHandler CellValueChanged

Event Data

The CellValueChanged event's data class is CellValueChangedEventArgs. The following properties provide information specific to this event:

Property Description
CellIndex Gets the processed cell’s index. Inherited from RowCellEventArgs.
RecordIndex Gets the index of the record containing the processed cell. Inherited from RowCellEventArgs.
Row Gets the processed row. Inherited from RowEventArgs.
Value Gets the current cell’s value.

Remarks

The CellValueChanged event fires in response to a cell’s value being changed. The list below points out the possible reasons for this event being raised:

  • an end-user has closed an inplace editor after changing the edited cell’s value;
  • a cell’s value has been changed using the methods provided by the grid control (for instance, the VGridControlBase.SetCellValue method);

The event doesn’t fire when a cell’s value is changed using the methods provided by the data source.

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.

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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CellValueChanged event.

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.

See Also