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

I have set the same datasource for two RadCombox win controls.The issue is If I change any of the combox selected Item, its reflecting other combo box also.

1 Answer 111 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.
Ragupathi
Top achievements
Rank 1
Ragupathi asked on 29 Oct 2008, 09:27 AM
I have set the same datasource for two RadCombox win controls.The issue is If I change any of the combox selected Item, its reflecting other combo box also.
Though I have created new datatables for both combobox.
How do I fix this issue,


                        DataTable dtKeyFields = genericDetails.GridDataSource;
                        dtKeyFields.TableName = "KeyFields";
                        cbxKeyField.DataSource = dtKeyFields;
                        cbxKeyField.DisplayMember = "ColumnName";

                        DataTable dtPrimarySearchFields = genericDetails.GridDataSource;
                        dtPrimarySearchFields.TableName = "PrimarySearchFields";
                        cbxPrimarySearchField.DataSource = dtPrimarySearchFields;
                        cbxPrimarySearchField.DisplayMember = "ColumnName";

thanks in Advance,
Raghu
                

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 31 Oct 2008, 04:44 PM
Hello Ragupathi,

The observed behavior is the standard one provided by Microsoft for databinding. The underlying data structure (in your case genericDetails.GridDataSource) has its own CurrencyManager which has a Position property. Even if you create two DataTables out of the base data source, the CurrencyManager for the actual data will be one and the same. So when you select a value in the first combo, the CurrencyManager.Position sets the selected value in the second combo. For additional information, please refer to MSDN.

The only approach here is to create two distinct data structures containing one and the same data.

I hope this helps. If you have additional questions, feel free to contact me.

Regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Ragupathi
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or