blanking a listbox

  • Thread starter Thread starter UpRider
  • Start date Start date
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
 
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.
 
Back
Top