Problem with new row binding....

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have
CM = BindingContext(DsModCont, "CONTACT"

I added a new row to "CONTACT"
Dim NewRow As DataRow = DsModCont.Tables("CONTACT").NewRo
CM.SuspendBinding(
DsModCont.Tables("CONTACT").Rows.Add(NewRow
CM.ResumeBinding(

But now even if the BindingContext(DsModCont, "CONTACT").Position is pointing to the new row, it's data is not being retrieved to my textboxes but only for the "old" rows
The only thing that works it to run a da.Update(DsModCont) and da.Fill(DsModCont)

Why ? and How do I fix

Thanks
Ori:)
 
Hi Ori,

This should not be needed for that.

As far as I know, is when a textbox is bounded to a column than only the
currency manager position affects it.

How do you do the binding from the column to the textbox?


Cor
 
I used the properties menu to define it (generate by windows form designer)

Me.TextBox2.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DsModCont, "CONTACT.cont_lname"))
 
Hi Ori,

I see nothing wrong, this should show an empty box

BindingContext(DsModCont, "CONTACT").Position = _
DsModCont("CONTACT").rows.count - 1

Cor
 
Ok......
I tried and tried and tried and..... (you get the idea

In the record I created, I use Boolean columns
Apperantly the binding had a problem with such columns until I asigned a False or True value before moving to pointe
to that row
So now I manually initialize all my Boolean fields in the new record before I set the .position to the new row
This way it works

Though I feel like this is a workaround, it there anything you think I might want to check in my DS or .mdb file definitions
(these fields are set to True/False format and default value "False" in my .mdb database
 
Hi Ori,

Did you use for that the binding.format and the binding.parse events?

If not have a look for that.

I hope this helps?

Cor
In the record I created, I use Boolean columns.
Apperantly the binding had a problem with such columns until I asigned a
False or True value before moving to pointer
to that row.
So now I manually initialize all my Boolean fields in the new record
before I set the .position to the new row.
This way it works.

Though I feel like this is a workaround, it there anything you think I
might want to check in my DS or .mdb file definitions ?
 
Back
Top