|
-
May 27th, 2011, 04:49 PM
#1
Thread Starter
New Member
[RESOLVED] Problem with databinding in c#
Goodevening,
i am trying to implement a 2 table database with a parent child relationship. Then i put in my form two gridviews. One for the parent and on for the child. The parent has 2 columns and an id and the child has 3 columns and the id of the parent. I post the code:
private void Form1_Load(object sender, EventArgs e)
{
// Dataset->BindingSource->Gridview
ownerBindingSource.DataSource = axisDataSet;
ownerBindingSource.DataMember = "owner";
ownerDataGridView.DataSource = ownerBindingSource;
//Child binding source
xyzBindingSource.DataSource = ownerBindingSource;
xyzBindingSource.DataMember = "FK_owner_xyz";
xyzDataGridView.DataSource = xyzBindingSource;
ownerBindingNavigator.BindingSource = ownerBindingSource;
// Bind the textboxcontrols with the table
addtextboxbind_com();
// TODO: This line of code loads data into the 'axisDataSet.owner' table. You can move, or remove it, as needed.
ownerTableAdapter.Fill(axisDataSet.owner);
// TODO: This line of code loads data into the 'axisDataSet.xyz' table. You can move, or remove it, as needed.
xyzTableAdapter.Fill(axisDataSet.xyz);
}
The problem is that even if the filter works ok i only see the id column of the child in the gridview when i should see 4 columns?What am i missing?
Thanks everybody,
ioigoume
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|