I have a simple datagrid listing addresses and a child window where the user can edit/add new. On the main form with the datagrid i have a button to "Insert New Address" which should load the child window with an empty Address object. However it will not let me add a record. Am i doing something wrong? my current code is as follows:
Dim address As New Address
Dim frmAddressObj As New frmAddress
If frmAddressObj.AddressDomainDataSource.DataView.CanAdd = False Then
frmAddressObj.AddressDomainDataSource.Load()
End If
frmAddressObj.AddressDomainDataSource.DataView.Add(address)
Address is the address object. frmAddress is the child window form. AddressDomainDataSource is the same datasource i use in the datagrid as i use in the child. CanAdd is always false and i got told to try loading before adding but this does not appear to have helped. When it reaches the Add method it returns an Exception of 'Add' is not supported by this ICollectionView. Any help would be appreciated. Thanks