To prevent the cell from leaving edit mode, you will need to handle ValidationError event of each DataCell in the grid and set the CancelEdit event argument to false.
VB.NET
gridControl1.BeginInit()
gridControl1.DataSource = dataSet11 gridControl1.DataMember = “Orders”
Dim cell As DataCell
For Each cell in gridControl1.DataRowTemplate.Cells AddHandler cell.ValidationError, AddressOf Me.cell_ValidationError Next cell
gridControl1.EndInit()
Private Sub cell_ValidationError( ByVal sender As Object, ByVal e As CellValidationErrorEventArgs ) ‘ code to prevent the cell from exiting edit mode e.CancelEdit = False End Sub
C#
gridControl1.BeginInit();
gridControl1.DataSource = dataSet11; gridControl1.DataMember = “Orders”;
foreach( DataCell cell in gridControl1.DataRowTemplate.Cells ) { cell.ValidationError += new CellValidationErrorEventHandler( this.cell_ValidationError ); }
gridControl1.EndInit();
private void cell_ValidationError( object sender, CellValidationErrorEventArgs e ) { // code to prevent the cell from exiting edit mode e.CancelEdit = false; }
|
Imported from legacy forums. Posted by Xceed admin (had 804 views)