Currency Manager Issue.

M

Manuel Canas

Hi there,

I have a form with a couple of tabs on in and I'm filling the form from a
dataset with the fill method. I am using a currency manager for binding
controls with a datatable.
mCurrencyManager = Me.BindingContext(dtTestTable)

dtTestTable holds the table that loading on the form.

I'm filling a listbox with names and the corresponding data gets displayed
on the right side of the form. kind of a treeview interface.



Now my problem is when I want to add a new record to the database, when I
invoke the mCurrencyManager.EndCurrentEdit() and then the
mCurrencyManager.AddNew method, the form or at least the current record does
not get blanked. on the listbox it goes to the end of it with a blank line
but it just does not end the current edit.

I have been trying so many things to find out why for the life of me, the
currency manager does respond to the .addnew method or EndCurrentEdit.

Can anybody out there tell or give some hints on how to make this work?

Thanks very much in advance,

Manny.
 
C

Cor Ligthert

Now my problem is when I want to add a new record to the database, when I
invoke the mCurrencyManager.EndCurrentEdit() and then the
mCurrencyManager.AddNew method, the form or at least the current record does
not get blanked. on the listbox it goes to the end of it with a blank line
but it just does not end the current edit.
Hi Manuel I assume you are talking about the dataset(datatable) instead of
the real database.

What the behaviour should be is that there is added a new blank line at the
end of the dataset which is showed at the end of the listbox. And I think
that that is happening, therefore what is it that you want to archieve?

Cor

Cor
 
M

Manuel Canas

Hey Cor,

Sorry I meant the dataset(datatable). when I execute the
mCurrencyManager.AddNew method, the blank line gets added at the end of the
listbox, but all the binded records don't get cleared, it stays at the
current one. I don't have any check boxes and I know there's a bug on the
framework but there's a solution for that one anyways.

I have two fields that are of money type on the database plus the id on the
table.

txtTextID.DataBindings.Add("Text", dvTest1, "TestID") integer on the
database
txtTextID.DataBindings.Add("Text", dvTest2, "Test2ID") money on the database

Could this be the problem? the .AddNew not recognizing or not being able to
convert this ones into the proper database type ?

Thanks very much,

Manuel
 
C

Cor Ligthert

txtTextID.DataBindings.Add("Text", dvTest1, "TestID") integer on the
database
txtTextID.DataBindings.Add("Text", dvTest2, "Test2ID") money on the
database

I saw it in the other newsgroup, probably you did not do
cma = Directcast(BindingContext(dvTest2), CurrencyManager)

And please no multipost again

I hope this helps?

Cor
 
M

Manuel Canas

Sorry Cor. No more multipostings.
I saw it in the other newsgroup, probably you did not do
cma = Directcast(BindingContext(dvTest2), CurrencyManager)

what would be the cma? what command?

Thanks,

Manuel
 
C

Cor Ligthert

You use a currencymanger somewhere however I think that you use it in
combination with the dataset(table) while you use for the databinding the
dataview.

Than you get the behaviour as you describe.

So I gues that it is that, othwerwise show some more code?

I hope this helps?

Cor
 

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