473,385 Members | 1,640 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,385 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 3009
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.