The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
ADAdministrator Syncfusion Team March 14, 2003 10:09 AM UTC
Hi.
I have had the same problem when the new row needs a foreign key value and I have to set it programically.
I use to add a handler like this
Private Sub InitializeClassRoomBookingsGrid()
AddHandler dsClassRoomBookings.tblClassRoomBookings.RowChanged, AddressOf HandleClassRoomBookingTableRowChanged
...
...
End Sub
And write the function it calls (HandleClassRoomBookingTableRowChanged)
' Purpose: Solves the problem with foreign keys when adding a new row to the
' dsClassRoomBookings.tblClassRoomBookings datatable.
' Input: sender = dsClassRoomBookings.tblClassRoomBookings datatable.
' e = DataRowChangeEventArgs
' Output: Setting the fields CRB_CRID to the same values as in the ClassRoomsListBox
Sub HandleClassRoomBookingTableRowChanged(ByVal sender As Object, ByVal e As System.Data.DataRowChangeEventArgs)
If e.Row("CRB_CRID") Is DBNull.Value Then
e.Row("CRB_CRID") = dsClassRooms.ClassRooms.Rows(ClassRoomsListBox.SelectedIndex)("CR_ID")
End If
End Sub
One problem you can bump into is that the Foreign key field doesnt allow Null values.
I solved it by using a strongly typed dataset and then you can change property for the field to allow Null values.
If this is your case and you dont understand the last part then reply on the message.