windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-cellvaluechangedeventargs-6855d624.md
Gets the handle of the row that contains the processed cell.
Namespace : DevExpress.XtraGrid.Views.Base
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public int RowHandle { get; }
Public ReadOnly Property RowHandle As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value indicating the handle of the row whose cell is processed by the event.
|
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);
}
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.BandedGrid
Private Sub BandedGridView1_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs) Handles BandedGridView1.CellValueChanged
Dim view As BandedGridView = sender
If view Is Nothing Then
Return
End If
If e.Column.Caption <> "FirstName" Then
Return
End If
Dim cellValue As String = e.Value.ToString() + " " + view.GetRowCellValue(e.RowHandle, view.Columns("LastName")).ToString()
view.SetRowCellValue(e.RowHandle, view.Columns("FullName"), cellValue)
End Sub
The following code snippets (auto-collected from DevExpress Examples) contain references to the RowHandle property.
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.
winforms-grid-highlight-modified-cells/CS/Form1.cs#L26
void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) {
if (!CellExists(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column)){
modifiedCells.Add(new GridCell(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column));
winforms-app-ui-automation-testing/CS/UIAutomationTestingExample/CustomersForm.cs#L37
void customersGridView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) {
modifiedItems.Add((Customer)customersGridView.GetRow(e.RowHandle));
}
winforms-grid-highlight-modified-cells/VB/Form1.vb#L28
Private Sub gridView1_CellValueChanged(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs)
If (Not CellExists(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column)) Then
modifiedCells.Add(New GridCell(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column))
winforms-app-ui-automation-testing/VB/UIAutomationTestingExample/CustomersForm.vb#L33
Private Sub customersGridView_CellValueChanged(ByVal sender As Object, ByVal e As Views.Base.CellValueChangedEventArgs)
modifiedItems.Add(CType(customersGridView.GetRow(e.RowHandle), Customer))
End Sub
See Also
CellValueChangedEventArgs Class