This is a migrated thread and some comments may be shown as answers.

Problem with indexchange

4 Answers 69 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Allan
Top achievements
Rank 1
Allan asked on 27 Jan 2008, 02:16 AM
I'm making a program containĂ­ng several comboboxes, all linked to a sql database through a tableadapter. The problem is that when i change the index in one of the of the comboboxes they all change indexes.

Does anyone have any idea as to why this happends?

4 Answers, 1 is accepted

Sort by
0
Espen
Top achievements
Rank 1
answered on 28 Jan 2008, 02:00 PM
This is just a wild stab in the dark, but are the datasources for the comboboxes hooked up to the same instance of the table(s) in use?

In other words :

DataTable dt = adapter.GetData();
cbo1.DataSource = dt;
cbo2.DataSource = dt;

If so it migth work if you do :

cbo1.DataSource = adapter.GetData();
cbo2.DataSource = adapter.GetData();

0
Georgi
Telerik team
answered on 29 Jan 2008, 02:56 PM
Hello Allan,

I am not sure what is your exact scenario, but (as Espen has already mentioned), if the comboboxes are attached to the same data source it is possible indices to be synchronized automatically. In fact, databinding mechanism and particulary CurrencyManager implement exactly this behavior (see: http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingcontext.aspx).

If you have any other questions regarding RadComboBox, please do not hesitate to write us.

Kind regards,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Allan
Top achievements
Rank 1
answered on 02 Jun 2008, 07:47 AM
Sorry for the late reply. But the solution worked, problem solved.

tnx...
0
Nikolay
Telerik team
answered on 02 Jun 2008, 09:00 AM
Hi Allan,

I am glad to hear that the issue is now resolved.

If you need additional assistance, do not hesitate to contact me.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Allan
Top achievements
Rank 1
Answers by
Espen
Top achievements
Rank 1
Georgi
Telerik team
Allan
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or