CellValueChangedEventHandler Delegate
Represents a method that will handle the ColumnView.CellValueChanging and ColumnView.CellValueChanged events.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.2.dll
Declaration
public delegate void CellValueChangedEventHandler(
object sender,
CellValueChangedEventArgs e
);
Parameters
Name | Type | Description |
---|---|---|
sender | Object | The event sender (the BaseView descendant representing the View that raised the event). |
e | CellValueChangedEventArgs | A CellValueChangedEventArgs object that contains event data. |
Remarks
When you create a CellValueChangedEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about delegates, see Events and Delegates in MSDN.
Example
The following sample code handles the ColumnView.CellValueChanged event to update the FullName column value after the FirstName column value has been changed.
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.BandedGrid;
private void bandedGridView1_CellValueChanged(object sender, CellValueChangedEventArgs e) {
BandedGridView view = sender as BandedGridView;
if (view == null) return;
if (e.Column.Caption != "FirstName") return;
string cellValue = e.Value.ToString() + " " + view.GetRowCellValue(e.RowHandle, view.Columns["LastName"]).ToString();
view.SetRowCellValue(e.RowHandle, view.Columns["FullName"], cellValue);
}