473,405 Members | 2,141 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,405 software developers and data experts.

Databound combobox

Hi everyone.

I have a user control with 2 comboboxes these comboboxes are Databound to
the same datatable..
Wheb 1 add 2 of thos usercontrols (not the comboboxes but the usercontrol
itself) to one form and change the value in one combobox, then they all (4)
change there selected value. Does anyone know a way to prevent this from
happening?

Thank you in advance

Nov 15 '05 #1
2 7978
Jan,

Since you are binding to the same data table, they are all using the
default views on the table, which means that they all have the same data
source. Because of this, when the position changes on one, they change on
all of them. My suggestion is to create a different instance of the
DataView class for each combobox, and bind to that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"jan v" <tght> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Hi everyone.

I have a user control with 2 comboboxes these comboboxes are Databound to
the same datatable..
Wheb 1 add 2 of thos usercontrols (not the comboboxes but the usercontrol
itself) to one form and change the value in one combobox, then they all (4) change there selected value. Does anyone know a way to prevent this from
happening?

Thank you in advance

Nov 15 '05 #2

"jan v" <tght> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl...
Ah thanks, didn't thought of that, thats why a combobox has a property
sorting, because it has a dataview.

I'll try it
"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote in message news:#r**************@TK2MSFTNGP10.phx.gbl...
Jan,

Since you are binding to the same data table, they are all using the
default views on the table, which means that they all have the same data
source. Because of this, when the position changes on one, they change on
all of them. My suggestion is to create a different instance of the
DataView class for each combobox, and bind to that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"jan v" <tght> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Hi everyone.

I have a user control with 2 comboboxes these comboboxes are Databound to the same datatable..
Wheb 1 add 2 of thos usercontrols (not the comboboxes but the usercontrol itself) to one form and change the value in one combobox, then they all (4)
change there selected value. Does anyone know a way to prevent this

from happening?

Thank you in advance



Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Smith | last post by:
Hello all: Another day another problem :). How do you synch a databound combobox with the rest of the controls that are on a form. I have a combobox that lists a bunch of names and upon...
1
by: Prem S | last post by:
Hi All I have a databound ComboBox control which is put into the second page of a tab control. When the form loads up, I databind the combo control and populate the control. When I go to...
0
by: Ken Arway | last post by:
Using .Net framework 1.1 I've got a Windows Forms application with a tab control having four tab pages. TabPage4 contains a Combobox and a TextBox, which are bound to the same XML file as a...
6
by: Johann Blake | last post by:
I fill a table in a dataset with values that will be used by a combobox for the combobox's items. The combobox is a drop down list that only allows the user to select from the list but not enter...
14
by: Rowland Shaw | last post by:
I've got a databound combo (databound to a System.Data.DataTable), but some rather unpredicatable behaviour -- even though I have 8 rows in the source table, only the first 6 are showing up in the...
7
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
2
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a...
3
by: Benny | last post by:
Does anyone know how I would go about adding a blank value to the list of items in a ComboBox that has a set datasource? Thank in advance!
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: 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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.