Posted on: 11/14/2011 10:15:50 PM | Views : 247

Hi guys,

I trying to filter a gridview with a dropdownlist, which is working fine. However, I want the option to return to viewing all. So, I've changed the DDL as so to add an All option with an empty string as the value:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="detachedSQL" appendDataBoundItems="true"
DataTextField="prevride_location" DataValueField="prevride_location">
<asp:ListItem text="All" Value=""></asp:ListItem>
</asp:DropDownList> However, whenever I select that item the GridView returns no results. Here is my code behind: Imports System.Data.SqlClient

Partial Class ridelist2
Inherits System.Web.UI.Page
Private Sub PopulateGrid(ByVal strLocation As String)
Dim strSQL As String
  'if statement to prevent apostrophes in database entri ...

Go to the complete details ...