(winform) dynamically adding multiple instances of a user control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
Are they both bound to the same datasource? In this case, they each need
their own instance of a bindingcontext.
 
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?
 
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
 
Back
Top