Results 1 to 2 of 2

Thread: RESOLVED: How to detach datasource from combo?

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    London
    Posts
    63

    Question RESOLVED: How to detach datasource from combo?

    Hi,

    I've got 4 combo boxes on a form, and each one is populated with a datasource ( which is a reference to an collection of objects).

    all 4 combos reference the same datasource.

    Now each one should be independant, but when you choose an item from any one of them, all the other combos change to that same item. This is probably because it is a reference to the datasource.

    How can I just load all the values from the datasource, and un-bind it.

    All I want to do is add the same list of objects to each combo, and allow the user to select say item 1, and in the background have the combo store the id of that item independantly of the other combo's.


    here's my code for the first two combos


    //populate the Locations combos
    DataStream ds = new DataStream();
    ds = m_oConf.GetDataStream(ds_uid, conf_uid);

    cboLocSrc.DataSource = null;
    cboLocSrc.Items.Clear();

    cboLocSrc.DataSource = ds.Locations.GetValueList();// listOfLocations;
    cboLocSrc.DisplayMember = "Name";
    cboLocSrc.ValueMember = "uid";
    cboLocSrc.SelectedValue = stage.loc_src_uid;


    DataStream ds1 = new DataStream();
    ds1 = m_oConf.GetDataStream(ds_uid, conf_uid);

    cboLocSrcAbn.DataSource = null;
    cboLocSrcAbn.Items.Clear();

    cboLocSrcAbn.DataSource = ds1.Locations.GetValueList();// listOfLocations;
    cboLocSrcAbn.DisplayMember = "Name";
    cboLocSrcAbn.ValueMember = "uid";
    cboLocSrcAbn.SelectedValue = stage.loc_src_abn_uid;


    When I run the program it just will not let me select items independantly.
    Last edited by Genie; Mar 7th, 2003 at 05:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width