comboboxcontrol on Winform2008
-
I am having two comboboxcontrol on Winform2008, whenever I am selecting value from one combo , then same text is coming in second combo, but just I want to separation in both ..
Vinay
-
I am having two comboboxcontrol on Winform2008, whenever I am selecting value from one combo , then same text is coming in second combo, but just I want to separation in both ..
Vinay
All you need to do is create two BindingSource objects and put them between the Combo's and the data. Each Combo will have its DataSource property set to one of the BindingSource objects. Then each BindingSource will have it's DataSource property point to the same data object. Something like this:
ComboBox1.DataSource ------> BindingSource1 -----\\ \\ +----> Data / ComboBox2.DataSource ------> BindingSource2 -----/
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
So are you saying that each combo should point to a different copy of the save data? Isn't that a little inefficient??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
All you need to do is create two BindingSource objects and put them between the Combo's and the data. Each Combo will have its DataSource property set to one of the BindingSource objects. Then each BindingSource will have it's DataSource property point to the same data object. Something like this:
ComboBox1.DataSource ------> BindingSource1 -----\\ \\ +----> Data / ComboBox2.DataSource ------> BindingSource2 -----/
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...See that's why I skulk around here, I have used the table.copy method to achieve this in the past as I have never used a bindingsource as a datasource for a combo. Thanks Dave
Never underestimate the power of human stupidity RAH
-
See that's why I skulk around here, I have used the table.copy method to achieve this in the past as I have never used a bindingsource as a datasource for a combo. Thanks Dave
Never underestimate the power of human stupidity RAH
Glad it'll help you. It's just a little something I found in someone elses brain droppings. :-D
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Glad it'll help you. It's just a little something I found in someone elses brain droppings. :-D
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...Dave Kreskowiak wrote:
It's just a little something I found in someone elses brain droppings
Yikes. The things you poke in. :~
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.