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.

2 posts, 0 answers
  1. Ragupathi
    Ragupathi avatar
    41 posts
    Member since:
    Jul 2008

    Posted 29 Oct 2008 Link to this post

    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
                    
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 31 Oct 2008 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top