frmsasp
Joined: 03 Sep 2005 Posts: 8
|
Posted: Wed Oct 12, 2005 6:08 am Post subject: Guide me how to show previously selected item in listbox |
|
|
Dear Friend,
Is anybody guide me how to show previously selected item in a listbox ?
I had used listbox control with multiple selection mode. I stored id with comma delimiter in database.
e.g.
1. List Item One.
2. List Item Two.
3. List Item Three.
4. List Item Four.
5. List Item Five.
Suppose user select item 2, 4 & 5. So I will store it as a 2,4,5 in database. This will work fine.
Now in editing I have to shows selection-bar for item 2, item 4 & item 5. So I had typed below source.
LstBoxPropHandling.SelectionMode = ListSelectionMode.Multiple;
for (j=0; j < PropSplit.Length; j++)
{
LstBoxPropHandling.SelectedValue = PropSplit[j].ToString();
}
But with this statement I got only last item id as a selected item with selectionbar. In our example 2,4,5 only item whose
id is 5 got as a selected item.
Is anybody guide me how to make item 2, item 4, item 5 as a selected item ?
Thanking You, |
|