Greetings,
I am busy developing an application which has two listboxes containing two variations of the same data.
I need to be able to keep the selected items synchronized.
Both listboxes must have the same item selected at the same time.
I need the two items to be selected next to each other.
The other problem is that I need to scroll the listboxes together.
Both when scrolling down and then across.
Does anyone out there have any ideas, or hopefully samples, to achieve this?
Thanks in advance,
zaroblan
Loading
fernando ingunzaPosted Jan 25, 2013, 9:31 AM
fernando ingunzaPosted Jan 25, 2013, 9:31 AM
Vimal KandasamyPosted Mar 12, 2009, 12:37 AM
hi...
for listbox synchronization...
add following code
private void listbox1_selectedIndexChanged(Object sender,EventArgs e)
{
listBox2.SelectedIndex=listBox1.SelectedIndex;
}
private void listbox2_selectedIndexChanged(Object sender,EventArgs e)
{
listBox1.SelectedIndex=listBox2.SelectedIndex;
}
when u run this code..if one listbox item gets selected then same item in other listbox will be selected...
when u scroll down & select an item in one list box then.. another listbox is also getting scrolled and select same item..try this.. it may help u...