Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Bindingsource.current does not point to newly added row in child band
posted

Hi,

 I have 2 tables(tableA, tableB) having parent/ child relationship (Rel_tableA_tableB).

2 BindingSources.

bsA.DataSource = tableA

bsB.Datamember=Rel_tableA_tableB

 bsB.DataSource=bsA

I have ultragrid having Datasource as bsA, due to relationship my grid shows 2 bands. I am trying to add a row in child band and setting default values for the columns by using the add button provided within grid.

the code is like this

Private Sub ugrdSubscriberMaintenance_AfterRowInsert(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.RowEventArgs) Handles ugrdSubscriberMaintenance.AfterRowInsert

Try

If e.Row.Band.Index = 0 Then

'...add default data for parent row

else

lobjDrv = CType(bsB.Current, DataRowView)

With lobjDrv

'defaults when a new detail is added

.Item("Date_Update") = Now  'there are more cols as well

bsB.EndEdit()

End With

End If

Catch ex As Exception

Throw

End Try

'********************************************

End Sub

Problem is

lobjDrv = CType(bsB.Current, DataRowView)....doesn't point to newly added row....it points to first row in the child band and whatever default we added goes to first row in the grid.

is this a known bug? Ultragrid version is 7.1.20071.1055.

Thanks in advance