bindingsource

S

silesius

Hi All,

I have two pagetabs. One pagetab is used to display a parent record and the
other is suppose to display 3 related child records from another table.
I can display the parent records just fine by using the bindingSource and a
tableAdapter to fill the dataset. I'm having a problem displaying the 3
related records on the other pagetab. I can only bind to one record and have
the bindingsource populate one set of databound contorls. I can't use a
grid and are using the detailed mode to drag data over from the data source.
I have one bindingSource control on the child pagetab. Is it possible to
have one bindingSource control bind three sets of databound controls and
have all three records displayed at the same time? If so, how?
TIA for any of your time.
rich
 
F

Frans Bouma [C# MVP]

silesius said:
Hi All,

I have two pagetabs. One pagetab is used to display a parent record
and the other is suppose to display 3 related child records from
another table. I can display the parent records just fine by using
the bindingSource and a tableAdapter to fill the dataset. I'm having
a problem displaying the 3 related records on the other pagetab. I
can only bind to one record and have the bindingsource populate one
set of databound contorls. I can't use a grid and are using the
detailed mode to drag data over from the data source. I have one
bindingSource control on the child pagetab. Is it possible to have
one bindingSource control bind three sets of databound controls and
have all three records displayed at the same time? If so, how? TIA
for any of your time. rich

The bindingsource has one datasource object, which should be your
dataset (with 4 tables: 1 for the main table and 3 for each child
table), and can be bound to various controls at once. At the controls
(the grids) you select the DataMEMBER from the datasource (which is the
bindingsource). So in the grids for the childs, you select per grid the
childtable you want to display there.

Frans

--
 
S

silesius

Thanks for your reply Frans,
I have only two tables. I'm displaying one record from one table and have to
display 3 child records from the second table. So it's a master-detail w/o
the use of a grid control. I need to have three sets of databound controls
with each set holding data from 3 rows in the same table. I know how to do
this the traditional way (contorl.databindins.add() ) but can't figure out
how can I make use of the bindingsource object to display the rows at the
same time on the screen in three sets.
rich
 
F

Frans Bouma [C# MVP]

silesius said:
Thanks for your reply Frans,
I have only two tables. I'm displaying one record from one table and
have to display 3 child records from the second table. So it's a
master-detail w/o the use of a grid control. I need to have three
sets of databound controls with each set holding data from 3 rows in
the same table. I know how to do this the traditional way
(contorl.databindins.add() ) but can't figure out how can I make use
of the bindingsource object to display the rows at the same time on
the screen in three sets. rich

My obvious thought was/is that you should bind the same bindingsource
to the 3 sets of controls for the child records. The bindingsource is
the datasource you should bind to, and IMHO you should just bind the
textboxes to the bindingsource as if you were doing it directly to the
datatable. But perhaps I misunderstand what you're working with (the
screensetup)

FB

--
 

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