Primary key update for AddNew value in GGC
Private Sub GGC1_RecordValueChanging(sender As Object, e As RecordValueChangingEventArgs) Handles GGC1.RecordValueChanging
End Sub
Just to let you know, initially, I had only the Call AuditTrail function, and with this only the Row behavior is good, but cannot get the proper PK value, specially if you deleted rows prior to this new addrow
I hope it's clear? Thanks in advance! - Nicolas
Attachment: screenshots_79585c8a.rar
To: Syncfusion Support <[email protected]>
Subject: RE: Syncfusion support community forum 127247, Primary key update for AddNew value in GGC, has been updated.
Please check my latest code
'Updates PK value
Me.Validate()
GlobalVariables.CurrentBindingSource.EndEdit()
MyTableTableAdapter.Update(GlobalVariables.curDT)
GridGroupingControl1.Table.TableDirty = True
'Audit trail
Call modMain.AuditTrailGGC(GridGroupingControl1, sender, e, "New", PID.Text)
'Update server value
Call UpdateSqlData(GlobalVariables.curDT, " [" & sender.TableDescriptor.Columns(0).Name & "] = " + PID.Text, e.Column, e.NewValue)
'Update GGC dataset
GridGroupingControl1.Table.Reload()
Now I have my dataset showing the good value, but I have still the same problem (Object reference not set to an instance of an object). - Nicolas
Private Sub GridGroupingControl1_TableControlCurrentCellEditingComplete(sender As Object, e As GridTableControlEventArgs) Handles GridGroupingControl1.TableControlCurrentCellEditingComplete
Dim style As GridTableCellStyleInfo = e.TableControl.GetTableViewStyleInfo(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex)
If Not IsNothing(style.TableCellIdentity.Column) AndAlso Not IsNothing(e.TableControl.CurrentCell.Renderer) AndAlso GlobalVariables.AddNew = 1 Then
Dim ColumnName As String = style.TableCellIdentity.Column.Name
Dim Value As Object = style.CellValue
Me.Validate()
GlobalVariables.CurrentBindingSource.EndEdit()
MyTableTableAdapter.Update(GlobalVariables.curDT)
Dim ID As Integer = DLastDT(sender.TableDescriptor.Columns(0).Name, GlobalVariables.curDT, "")
Call AuditTrailGGC_New(GridGroupingControl1, sender, "New", ID, ColumnName, Value)
GlobalVariables.AddNew = 0
End If
End Sub
- 10 Replies
- 3 Participants
-
NI Nicolas
- Nov 4, 2016 08:31 PM UTC
- Nov 14, 2016 05:32 AM UTC