473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 3013
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jack David | last post by:
I have a number of web user controls that I want to be able to load into a page. I want to be able to define what controls to include in the page, and what order they should appear in. I am using...
1
by: David J. Berman | last post by:
Thanks for any help...! My error is: Object reference not set to an instance of an object. > public int DisplayOrder { > get { >>>>>> return (int) ViewState; > }
3
by: ram | last post by:
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...
0
by: Bob Harrison | last post by:
After installing the Media SDK and looking at the vb sample I was able to create a control that includes the media player plus other form controls. I want to add multiple instances of this control...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
7
by: =?Utf-8?B?Li46OiBLZXZpbiA6Oi4u?= | last post by:
I have a problem with accessing controls that I have loaded dynamically and added to a web page. The scenario: I have a webpage that displays multiple instances of a user control on the page. ...
1
by: jelle.huygen | last post by:
Hello, I have a problem in ASP.NET 2.0 with the viewstate of my dynamically added user control. I have reproduced the problem with a very simple user control and a very simple page. On my...
7
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have a WinForm application that, depending on user actions, may spin for a while doing extensive calculations, showing a progress bar in the meantime. I would like to be able to launch a second...
4
by: Lewis Holmes | last post by:
Hi I have the following situation in one of my asp.net pages. The user can add multiple table rows to a form by selecting a button. These rows can contain asp.net controls. When this button is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.