I have a listview that is bound to a sqldatasource. I know how to filter the results by binding the sqldatasourceto a control value, but I want the sqldatasource to select all when nothing in the control is selected. How do i do that?
Keep in mind that i have the listview paged as I know this can pose problems to simple solutions. For instance, if I handle the initial load with !Page.IsPostback, the initial contents of the list is fine, but if I click on a page in the pager control, it will reload the grid with whatever name is selected in the filter dropdown.
You can use the SqlDataSource
Selectingevent to modify parameters before the select command gets executed.C#
VB
Here’s the MSDN article on SqlDataSource.Selecting Event