How to maintain state of the listbox while it is bound to Datasource?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have bound my listbox to a dataset. But when I select multiple choices from the listbox, when I again come back to that list box the selected items are lost

I have 2 tabs. One has bounded listbox, so when I select multiple items and then go to the other tab and then came back to the first one the selected items are lost

Pl help
 
To populate a multi-select, you end up having to loop through data. You
should not have to do this if you are simply returning to a form from a
submit within that form (ViewState should handle that), but is a very real
issue when binding data to a listbox. The multi-select is normally bound to
a separate table, so simply loop through that table to set the SelectedValue
+= the value of the var in the loop.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
Shalin Parmar said:
Hi,

I have bound my listbox to a dataset. But when I select multiple choices
from the listbox, when I again come back to that list box the selected items
are lost.
I have 2 tabs. One has bounded listbox, so when I select multiple items
and then go to the other tab and then came back to the first one the
selected items are lost.
 
Back
Top