blanking a listbox

U

UpRider

I have a gridview that supplies a parameter to a query that populates a
listbox via a sqlDataSource. Works fine. When I change the page of the
gridview (and I deselect the gridview row via code in the pagechange event),
the existing rows in the listbox remain there, even though no row in the
gridview is selected. How do I fix this? Listbox.databind after deselecting
the gridview row does not work.
TIA,
UpRider
 
A

Alexey Smirnov

I have a gridview that supplies a parameter to a query that populates a
listbox via a sqlDataSource.  Works fine.  When I change the page of the
gridview (and I deselect the gridview row via code in the pagechange event),
the existing rows in the listbox remain there, even though no row in the
gridview is selected.  How do I fix this? Listbox.databind after deselecting
the gridview row does not work.
TIA,
UpRider

Add ListBox1.Items.Clear() to PageIndexChanging event. This would
remove all items from the listbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top