AD
Administrator
Syncfusion Team
May 18, 2006 04:32 AM UTC
Hi Jenny,
Typically this types of error occurs if you are not properly handle CurrentCell.IsModified flag. Without setting the CurrentCell.IsModified = true, your saveCellInfo is not called when you leave the cell the control which means your changes were not being saved in the grid. SaveCellInfo event fires the CurrentCellValidating Event. Please try this code in CurrentcellMoving Event
Private Sub gridControl1_CurrentCellValidating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles gridControl1.CurrentCellValidating
Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell
Dim user As UserControl1 = CType(IIf(TypeOf cc.Renderer.Control Is UserControl1, cc.Renderer.Control, Nothing), UserControl1)
If Not user Is Nothing Then
MessageBox.Show(user.Uservalue,"Selected Language")
End If
End Sub
Private Sub gridControl1_CurrentCellMoving(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCurrentCellMovingEventArgs) Handles gridControl1.CurrentCellMoving
Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell
If cc.MoveFromRowIndex = 1 AndAlso cc.MoveFromColIndex = 1 Then
Dim user As UserControl1 = CType(IIf(TypeOf cc.Renderer.Control Is UserControl1, cc.Renderer.Control, Nothing), UserControl1)
If Not user Is Nothing Then
cc.IsModified = True
End If
End If
End Sub
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/VBControlValidating_49578baf.zip
Let me know if you have any more questions.
Regards,
Haneef
JW
Jenny Wilson
May 18, 2006 11:04 PM UTC
Setting the IsModified property in CurrentCellMoving was just what I needed.
Thanks!