Problem with DataBinding in Navigation Control

  • Thread starter Dessipris Antonis
  • Start date
D

Dessipris Antonis

Hi,
I have built a navigation control... with buttons such
as "Search", "New", "Edit", "Delete", "Save", "Previous",
"Next" etc etc...
Everything works pretty fine except the "New"
function... What i wanna do, is when i press the "New"
Button i should add a new empty row to the dataset
like
ds.tables(TempTable).Rows.Add(ds.Tables(TempTable).NewRow)
and refresh the bindingmanagerbase and make it point to
the last row of my dataset (which is the new inserted row)
so someone can fill the values for the new record and
press the "Save" button.
My problem is that though the dataset has changed and has
one more row, everything i tried to do with the
BindManagerBase didn't seem to work... and at the command
BmB.Position = Bmb.Count - 1
it points me to the position i was before
(I tried also to make BmB nothing and set it again to the
new dataset but nothing)
Does anyone have a clue how am i gonna make this work?!

Thank you
 
M

Marinescu Ionut

I've written a similar control that had a similar problem.
I have a dateTimePicker who's "value" is bound to a
datebase column that can contain null dates.The "Add"
button that calls CurrencyManager.AddNew() didn't work
until i changed the bind to "Text" property of the
dateTimePicker.
The point is that i've removed the binding of my controls
and then binded again one by one to find which control's
bind was the problem.
I must admit i don't why it works binding to "Text" and
not to "Value" (for null dates).
i hope you find what's wrong in your code.
 

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