BindingSource problem?

K

Kyote

I'm making a small app for a few friends of mine. It's for membership
info. It uses multiple tabs. It connects to an access DB with 2
tables.

On one tab it has a datagridview control on it and it's datasource is
set to my access DB. It's datamember is set to the only
table(Membership) that I need in the DB. This works fine. The DGView
control works just fine.

On another tab I have a BindingNavigator. I've tried to set it to use
the same BindingSource. But I seem to be having trouble doing that.

On tab1 with the DGview control I have it's doubleclick event set to
switch to tab3 where the BindingNavigator is at. It then updates the
BNavigator to the record I double clicked on in tab1. But it don't
seem to work unless I set the BNavigator to a different BindingSource.
If I use 2 different BindingSources, one for each control set to the
same DataSet, then everything seems to work flawlessly.

But when running the app and trying to resort the columns, lets say
the last names, in alphabetical order, when it switches to tab3 where
the BNavigator is and updates it, it isn't to the new row count from
tab1's DGView. It displays a record but not the one I had double
clicked in on tab1.

I'm thinking that each separate BS maintains it's own row count, or
order. And when I change the DGView's row order, the other BSource
isn't organized in the same way.

1) Does anyone know if that is indeed what's happening or is it
something else?
2) Is there a way to get both the DGView and the BNavigator to use the
same BSource?
 
G

Guest

I am no expert, but I believe that ths BS object actually uses a dataview
object under the hood. So when you set the datasoure and datamember, the BS
creates a Dataview of that table. I think that if you create your own
dataview object and assign it as the datasource for both BS objects, they
will stay in synch. As far as your second question, I have no idea.
 

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