Does not fire CurrentChanged

D

Domingos Jr.

Hello All,

I have a Form with a hierarchical DataSet (2 tables, "Companies",
"Contacts").
When the CurrentChanged event for the bindingcontext of "Companies" changes
I refresh the child DataTable as follows:

dt.Clear()
dt.BeginLoadData()
Dim dr() As DataRow = drv.Row.GetChildRows(dataRelName)
Dim i As Integer
For i = 0 To dr.GetUpperBound(0)
dt.LoadDataRow(dr(i).ItemArray, True)
Next
dt.EndLoadData()

But, since I'm calling "Clear" in the DataTable I no longer receive the
CurrentChanged event for the "Contacts" bindingcontext and this event is
essential for what I am doing.
How can I receive events after clearing the DataTable? Is there a better way
of getting Child Rows in a DataTable replacing the ones that were there
(contacts of another Company, for instance)?

Thanks in advance.

Domingos Jr.
 
D

Domingos Jr.

Domingos,
How about just clearing out the Table's Rows collection?
e.g. dt.Rows.Clear()

It didn't work! I think that a solution might be to use
RowFilter = "companyId=" & CStr(mainRec("companyId"))

[ ]'s
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top