471,320 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

(winform) dynamically adding multiple instances of a user control

ram
I have a user control uc (with a dropdownlist uc_dd) that I dynamically add
to a pane on a button_click. this pane is hosted on the winform. now when I
add two instances of the user control (uc_dd1, uc_dd2), and change the
selected item in the dropdown uc_dd1, the selected item in uc_dd2 also
changes. any ideas?

thank you!

Jul 21 '05 #1
3 2889
Are they both bound to the same datasource? In this case, they each need
their own instance of a bindingcontext.

"ram" <ra*@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
I have a user control uc (with a dropdownlist uc_dd) that I dynamically add
to a pane on a button_click. this pane is hosted on the winform. now when
I
add two instances of the user control (uc_dd1, uc_dd2), and change the
selected item in the dropdown uc_dd1, the selected item in uc_dd2 also
changes. any ideas?

thank you!

Jul 21 '05 #2
ram
the dropdown in the user control is databound to a dataview.
wouldn't creating different instances of the user control create different
bindingcontext instances? how would you explicitly create a different
bindingcontext?

"Marina" wrote:
Are they both bound to the same datasource? In this case, they each need
their own instance of a bindingcontext.

"ram" <ra*@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
I have a user control uc (with a dropdownlist uc_dd) that I dynamically add
to a pane on a button_click. this pane is hosted on the winform. now when
I
add two instances of the user control (uc_dd1, uc_dd2), and change the
selected item in the dropdown uc_dd1, the selected item in uc_dd2 also
changes. any ideas?

thank you!


Jul 21 '05 #3
Ram,

A little bit else told than Marina.

You can create different datasources by creating more (new) dataviews (and
with that bindingcontext).

The message is the same.

I hope this helps,

Cor
Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jack David | last post: by
1 post views Thread by David J. Berman | last post: by
reply views Thread by Bob Harrison | last post: by
7 posts views Thread by =?Utf-8?B?Li46OiBLZXZpbiA6Oi4u?= | last post: by
1 post views Thread by jelle.huygen | last post: by
7 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | 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.