My Program: a local C# ADO.Net application using VS 2003
Right now I have about 5 ComboBox's which provides drop down selection
entries from the same MS-Access table via a DataConnection, DataAdapter and
DataSet datasource. Each CB has it's own DA and DS. When I tried to use the
same DS as the datadource for each of the five CB's, changing one of the CB's
selection affectd the other four CB's.
New business requirements require I increase the number of CB's from 5 to
about 100. What do I do? Do I create 100 DA and DS?
Steve 8 1946
Hi,
inline
"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com... My Program: a local C# ADO.Net application using VS 2003
Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection, DataAdapter and DataSet datasource. Each CB has it's own DA and DS. When I tried to use the same DS as the datadource for each of the five CB's, changing one of the CB's selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can
use a different BindingContext :
comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow independent
navigating.
HTH,
greetings New business requirements require I increase the number of CB's from 5 to about 100. What do I do? Do I create 100 DA and DS?
Steve
Hi,
inline
"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com... My Program: a local C# ADO.Net application using VS 2003
Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection, DataAdapter and DataSet datasource. Each CB has it's own DA and DS. When I tried to use the same DS as the datadource for each of the five CB's, changing one of the CB's selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can
use a different BindingContext :
comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow independent
navigating.
HTH,
greetings New business requirements require I increase the number of CB's from 5 to about 100. What do I do? Do I create 100 DA and DS?
Steve
Bart
Thank You for responding. Great Idea. Will try it this weekend.
One question, the DataSource and DisplayMember assignments are in VS CB
properties window. Where do I put the comboBox1.BindingContext = new
BindingContext() statement so I get it in the order you specified or can I
put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get "new
BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove the
CB DataSource and DisplayMemeber and put it all in my code after the
InitializeComponent();
Steve
"Bart Mermuys" wrote: Hi, inline
"Steve B." <St****@discussions.microsoft.com> wrote in message news:82**********************************@microsof t.com... My Program: a local C# ADO.Net application using VS 2003
Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection, DataAdapter and DataSet datasource. Each CB has it's own DA and DS. When I tried to use the same DS as the datadource for each of the five CB's, changing one of the CB's selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can use a different BindingContext :
comboBox1.BindingContext = new BindingContext(); comboBox1.DataSource = ds; // same datasource comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext(); comboBox2.DataSource = ds; // same datasource comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which mantains position) for the same datasource/datamember and allow independent navigating.
HTH, greetings
New business requirements require I increase the number of CB's from 5 to about 100. What do I do? Do I create 100 DA and DS?
Steve
Bart
Thank You for responding. Great Idea. Will try it this weekend.
One question, the DataSource and DisplayMember assignments are in VS CB
properties window. Where do I put the comboBox1.BindingContext = new
BindingContext() statement so I get it in the order you specified or can I
put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get "new
BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove the
CB DataSource and DisplayMemeber and put it all in my code after the
InitializeComponent();
Steve
"Bart Mermuys" wrote: Hi, inline
"Steve B." <St****@discussions.microsoft.com> wrote in message news:82**********************************@microsof t.com... My Program: a local C# ADO.Net application using VS 2003
Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection, DataAdapter and DataSet datasource. Each CB has it's own DA and DS. When I tried to use the same DS as the datadource for each of the five CB's, changing one of the CB's selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can use a different BindingContext :
comboBox1.BindingContext = new BindingContext(); comboBox1.DataSource = ds; // same datasource comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext(); comboBox2.DataSource = ds; // same datasource comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which mantains position) for the same datasource/datamember and allow independent navigating.
HTH, greetings
New business requirements require I increase the number of CB's from 5 to about 100. What do I do? Do I create 100 DA and DS?
Steve
Hi,
"Steve B." <St****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com... Bart
Thank You for responding. Great Idea. Will try it this weekend.
One question, the DataSource and DisplayMember assignments are in VS CB properties window. Where do I put the comboBox1.BindingContext = new BindingContext() statement so I get it in the order you specified or can I put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get "new BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove the CB DataSource and DisplayMemeber and put it all in my code after the InitializeComponent();
It doesn't matter where you bind, from code or with the properties window.
The new BindingContext assignments can only be done in in code. A good
place would be after InitializeComponent() in the constructor.
If you want independent navigating, sorting and filtering, you can:
Create a different dataview for each combox and bind that ( from code or
designer ) .
If you only want independent navigating you can gain some performance:
Create a single dataview (designer or code) and bind that to all ComboBoxes
and then give each ComboBox a new BindingContext from code.
HTH,
greetings Steve
"Bart Mermuys" wrote:
Hi, inline
"Steve B." <St****@discussions.microsoft.com> wrote in message news:82**********************************@microsof t.com... > My Program: a local C# ADO.Net application using VS 2003 > > Right now I have about 5 ComboBox's which provides drop down selection > entries from the same MS-Access table via a DataConnection, DataAdapter > and > DataSet datasource. Each CB has it's own DA and DS. When I tried to > use > the > same DS as the datadource for each of the five CB's, changing one of > the > CB's > selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can use a different BindingContext :
comboBox1.BindingContext = new BindingContext(); comboBox1.DataSource = ds; // same datasource comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext(); comboBox2.DataSource = ds; // same datasource comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which mantains position) for the same datasource/datamember and allow independent navigating.
HTH, greetings
> > New business requirements require I increase the number of CB's from 5 > to > about 100. What do I do? Do I create 100 DA and DS? > > Steve > >
Hi,
"Steve B." <St****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com... Bart
Thank You for responding. Great Idea. Will try it this weekend.
One question, the DataSource and DisplayMember assignments are in VS CB properties window. Where do I put the comboBox1.BindingContext = new BindingContext() statement so I get it in the order you specified or can I put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get "new BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove the CB DataSource and DisplayMemeber and put it all in my code after the InitializeComponent();
It doesn't matter where you bind, from code or with the properties window.
The new BindingContext assignments can only be done in in code. A good
place would be after InitializeComponent() in the constructor.
If you want independent navigating, sorting and filtering, you can:
Create a different dataview for each combox and bind that ( from code or
designer ) .
If you only want independent navigating you can gain some performance:
Create a single dataview (designer or code) and bind that to all ComboBoxes
and then give each ComboBox a new BindingContext from code.
HTH,
greetings Steve
"Bart Mermuys" wrote:
Hi, inline
"Steve B." <St****@discussions.microsoft.com> wrote in message news:82**********************************@microsof t.com... > My Program: a local C# ADO.Net application using VS 2003 > > Right now I have about 5 ComboBox's which provides drop down selection > entries from the same MS-Access table via a DataConnection, DataAdapter > and > DataSet datasource. Each CB has it's own DA and DS. When I tried to > use > the > same DS as the datadource for each of the five CB's, changing one of > the > CB's > selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can use a different BindingContext :
comboBox1.BindingContext = new BindingContext(); comboBox1.DataSource = ds; // same datasource comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext(); comboBox2.DataSource = ds; // same datasource comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which mantains position) for the same datasource/datamember and allow independent navigating.
HTH, greetings
> > New business requirements require I increase the number of CB's from 5 > to > about 100. What do I do? Do I create 100 DA and DS? > > Steve > >
Bart,
Again thank you for the free input
Yes, I do want sorting of the comboBox dropdown but didn't know how to do it
Not real familar dataview but have used it once or twice - need to check it
out.
"Bart Mermuys" wrote: Hi,
"Steve B." <St****@discussions.microsoft.com> wrote in message news:D4**********************************@microsof t.com... Bart
Thank You for responding. Great Idea. Will try it this weekend.
One question, the DataSource and DisplayMember assignments are in VS CB properties window. Where do I put the comboBox1.BindingContext = new BindingContext() statement so I get it in the order you specified or can I put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get "new BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove the CB DataSource and DisplayMemeber and put it all in my code after the InitializeComponent();
It doesn't matter where you bind, from code or with the properties window. The new BindingContext assignments can only be done in in code. A good place would be after InitializeComponent() in the constructor.
If you want independent navigating, sorting and filtering, you can: Create a different dataview for each combox and bind that ( from code or designer ) .
If you only want independent navigating you can gain some performance: Create a single dataview (designer or code) and bind that to all ComboBoxes and then give each ComboBox a new BindingContext from code.
HTH, greetings
Steve
"Bart Mermuys" wrote:
Hi, inline
"Steve B." <St****@discussions.microsoft.com> wrote in message news:82**********************************@microsof t.com... > My Program: a local C# ADO.Net application using VS 2003 > > Right now I have about 5 ComboBox's which provides drop down selection > entries from the same MS-Access table via a DataConnection, DataAdapter > and > DataSet datasource. Each CB has it's own DA and DS. When I tried to > use > the > same DS as the datadource for each of the five CB's, changing one of > the > CB's > selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can use a different BindingContext :
comboBox1.BindingContext = new BindingContext(); comboBox1.DataSource = ds; // same datasource comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext(); comboBox2.DataSource = ds; // same datasource comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which mantains position) for the same datasource/datamember and allow independent navigating.
HTH, greetings
> > New business requirements require I increase the number of CB's from 5 > to > about 100. What do I do? Do I create 100 DA and DS? > > Steve > >
Bart
Hope your still there, It gets a little more differcult.
The db may already have a entry for that field that should be loaded as
ComboBox.text when the form opens. The user should also have a choice to
edit the field without changing the other 20 "charaCode" fields
From IntializeComponent() method:
this.charaCode1CB.DataBindings.Add(new System.Windows.Forms.Binding("Text",
this.csiDbDS, "Main.CharacteristicCodes1"));
Adding "charaCode1CB.BindingContext = new BindingContext();" seems to
remove that previous binding
Steve
"Bart Mermuys" wrote: Hi, inline
"Steve B." <St****@discussions.microsoft.com> wrote in message news:82**********************************@microsof t.com... My Program: a local C# ADO.Net application using VS 2003
Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection, DataAdapter and DataSet datasource. Each CB has it's own DA and DS. When I tried to use the same DS as the datadource for each of the five CB's, changing one of the CB's selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can use a different BindingContext :
comboBox1.BindingContext = new BindingContext(); comboBox1.DataSource = ds; // same datasource comboBox1.DisplayMember = ....;
comboBox2 .BindingContext = new BindingContext(); comboBox2.DataSource = ds; // same datasource comboBox2.DisplayMember = ....;
.....
This way the comboboxes will create different CurrencyManagers(which mantains position) for the same datasource/datamember and allow independent navigating.
HTH, greetings
New business requirements require I increase the number of CB's from 5 to about 100. What do I do? Do I create 100 DA and DS?
Steve
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: |
last post by:
I have made a Visual Basic.NET Program that pull info
from
a Form with a ComboBox that pulls info from one table.
Then when you click the save button it should update a
different table in Sql...
|
by: Steve B. |
last post by:
My Program: a local C# ADO.Net application using VS 2003
Right now I have about 5 ComboBox's which provides drop down selection
entries from the same MS-Access table via a DataConnection,...
|
by: Alpha |
last post by:
I have a small Window application and through out the different forms I
create a different dataset. At the begining I used the Tools to drag and
drop the SqlDataAdapter, connection and dataset...
|
by: Dany P. Wu |
last post by:
Hi everyone,
As usual, weekend is tinkering time for students and I'm playing with
combobox databinding for the first time. Previously I have always iterated
through the records and added each...
|
by: redwebgeek |
last post by:
Hi,
I've been searching this one for two days so thought I give this a
shot again. I have two datasets Dataset1 and Dataset2
Dataset1 populates a datagrid and dataset2 populates a combobox...
|
by: Phil |
last post by:
I need to created a typed dataset for a xml flat file and bind that dataset
to a combobox. I was able to do this in VS.Net 2003 easy enough, but can't
get it to work in VS.Net 2005. I've come...
|
by: massenza |
last post by:
All,
Still a newbie, could someone help me out with this. When I load/Open my form my comboboxes which are tied to datasets all have the first value of the dataset listed in the text area of the...
|
by: =?Utf-8?B?RyBIdXN0aXM=?= |
last post by:
This is the 2nd time posting so sorry for duplications.
I am using VB.NT 2005 & a standard Combobox.
I've been wracking my brain over this problem for a over a month & cannot
seem to find a way to...
|
by: BillE |
last post by:
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.
When I use a business object to populate a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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
|
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: 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...
|
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,...
|
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...
|
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...
| |