[02/03] Listbox questions
I was wondering when I select a row in listbox1, how do I automatically select a row in listbox2 too?
Another question is how do I allow 2 fields of my database to be populated to my listbox? Example modulecode and modulename values are shown in listbox.
I tried using this code but it did not work. I am certain that the modulecode is the first and primary key column.
VB Code:
Dim cap As New CAPS_BIZ1.Service1
ListBox1.DataSource = cap.populateAssignedData()
ListBox1.DataTextField = "modulecode"
ListBox1.DataValueField = "modulename"
ListBox1.DataBind()
What should I do?
Re: [02/03] Listbox questions
#1Q
Set the first listbox autopostback to True , double click listbox 1 , enter this code
this.ListBox2.SelectedIndex = this.ListBox1.SelectedIndex;