Public Overrides Sub NavigateData(ByVal navPosition As mmNavigate, ByVal raiseEvents As Boolean) If raiseEvents AndAlso (navPosition <> mmNavigate.Refresh And navPosition <> mmNavigate.Update) Then If Not (Me.ActiveControl Is Nothing) Then ' Make sure the current UI control value is written back to the data Dim grid As mmDataGrid = CType(Me.ActiveControl.Parent, mmDataGrid) grid.EndEdit(Nothing, grid.CurrentRowIndex, False) If TypeOf grid.DataSource Is DataSet Then Dim ds As DataSet = CType(grid.DataSource, DataSet) ' Determine the table name Dim TableName As String = Nothing Dim ViewName As String = Nothing Dim BizObj As mmBusinessObject = CType(mmAppDesktop.FormMgr.GetControlBizObj(grid), mmBusinessObject) If Not (BizObj Is Nothing) Then mmBindingStrategyBase.GetBindingSource(BizObj, grid.BindingSourceMember, TableName, ViewName) End If If Not mmString.Empty(TableName) Then ds.Tables(TableName).Rows(grid.CurrentRowIndex).EndEdit() Else ds.Tables(0).Rows(grid.CurrentRowIndex).EndEdit() End If Else If TypeOf grid.DataSource Is DataView Then Dim dv As DataView = CType(grid.DataSource, DataView) dv.Table.Rows(grid.CurrentRowIndex).EndEdit() End If End If Else Dim cntrl As Control = CType(Me.ActiveControl, Control) If cntrl.DataBindings.Count > 0 Then Me.BindingContext(cntrl.DataBindings(0).DataSource).EndCurrentEdit() End If End If ' Check for changes If Me.IsChanged() Then Dim CancelControl As Control = Me.FocusOnCancelControl Dim SaveControl As Control = Me.FocusOnSaveControl Me.FocusOnCancelControl = Nothing Me.FocusOnSaveControl = Nothing ' Ask the user if they want to save changes Dim result As DialogResult = Me.AskSaveChanges() Me.FocusOnCancelControl = CancelControl Me.FocusOnSaveControl = SaveControl If result = DialogResult.Cancel Then Return End If End If End If MyBase.NavigateData(navPosition, raiseEvents) End SubRegards,