scott

scott

  • NA
  • 2
  • 0

databound listbox help

Jan 12 2009 6:15 PM
Hi, i'm currently doing a uni project and I'm having a bit of trouble with a databound listbox.

Basically it's two listboxs, listbox1 is databound to a access database and it's getting the information fine
what i'm trying to achieve is that when you select an item from the listbox1 it is added to listbox2.

So far when the you select the item from listbox1, the index number of the selected item is added to listbox 2,


        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

            if (listBox1.SelectedIndex != -1)
            {
     //           int x = listBox1.SelectedIndex;
                {
    //                string orderitem = Convert.ToString(listBox1.Items[x]);

                    listBox3.Items.Add(listBox1.SelectedIndex);
                }
            }
        }

any ideas how i can get the actually information added?

the two lines i have commented out where just an idea i had, which didn't work


cheers, Scott

Answers (1)