Problem with indexchange

5 posts, 0 answers
  1. Allan
    Allan avatar
    8 posts
    Member since:
    Jan 2008

    Posted 26 Jan 2008 Link to this post

    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?
  2. Espen
    Espen avatar
    11 posts
    Member since:
    Jan 2008

    Posted 28 Jan 2008 Link to this post

    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();

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 29 Jan 2008 Link to this post

    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
  5. Allan
    Allan avatar
    8 posts
    Member since:
    Jan 2008

    Posted 02 Jun 2008 Link to this post

    Sorry for the late reply. But the solution worked, problem solved.

    tnx...
  6. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 02 Jun 2008 Link to this post

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