Back to Devexpress

How to: Get the Currently Edited Value

windowsforms-3019-controls-and-libraries-data-grid-examples-data-editing-how-to-get-the-currently-edited-value.md

latest729 B
Original Source

How to: Get the Currently Edited Value

  • Nov 13, 2018

The following code shows how you can obtain the text representation of the currently edited cell value.

csharp
using DevExpress.XtraGrid.Views.Base;

ColumnView view = gridControl1.FocusedView as ColumnView;
string editingValue = null;
if (view != null && view.IsEditing)
    editingValue = view.EditingValue.ToString();
vb
Imports DevExpress.XtraGrid.Views.Base

Dim view As ColumnView = CType(GridControl1.FocusedView, ColumnView)
Dim editingValue As String = Nothing
If view IsNot Nothing And view.IsEditing Then
    editingValue = view.EditingValue.ToString()
End If