471,310 Members | 1,042 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

Databinding child table, bindingnavigator problem

I have a child table (the "TestType" that is in my code below) that I am trying to bind to its parent ("Test" in the code. I've commented out that line below sice it doesn't fix my problem).
The Test table is bound to a BindingNavigator.

Everything displays ok. In other words, when I click the advance or back buttons of the navigator, the nameTextBox1 control shows the correct Test text, and the TestTypeControl (which is my user control) shows the test types. The problem is that TestType gets displayed not for the Test it should be bound to, but for the previous Test. In other words (again), If the test sequence when advancing is Test2, Test3, Test4, etc., the TestType is shown as TestType1, TestType2, TestType3, etc. So it looks like when I click the advance button of the navigator control, the TestType control is bound to the current bindingsource before Test is advanced. What I need is for Test to be advanced first, then TestType to be bound.

So how do I make the bindingNavigator perform its default action before the rest of the bindingNavigator1_ItemClicked function is performed.

Thanks.

Chuck Gantz

private void bindingNavigator1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)

{

flowLayoutPanel1.Controls.Clear();

int cnt = testTypeBindingSource.List.Count;

//nameTextBox1.Text = ((BBTB.TestRow)((DataRowView)(testBindingSource.Cu rrencyManager.)).Row).name;

foreach (object row in testTypeBindingSource.List)

{

TestTypeControl ttCtl = new TestTypeControl();

ttCtl.Parent = flowLayoutPanel1;

ttCtl.TestTypeName = ((BBTB.TestTypeRow)((DataRowView)row).Row).name;

}

}

Jan 7 '06 #1
0 1025

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Dotnet Newbie | last post: by
reply views Thread by Jacek Jurkowski | last post: by
reply views Thread by Jacek Jurkowski | last post: by
5 posts views Thread by david.kao | last post: by
3 posts views Thread by Kevin Swanson | last post: by
3 posts views Thread by =?Utf-8?B?UmljaCBIdXRjaGlucw==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.