title: Link to records with a specific letter in a GridView
body: <p>I have an ASP.NET GridView in a Web Form. This GridView using a SqlDataSource and utilizes paging and searching. For the sake of reference, here is the trimmed down version of it:</p>
  
  <pre><code>&lt;asp:SqlDataSource ID="myDataSource" runat="server"
    ConnectionString="&lt;%$ ConnectionStrings:DB %&gt;"
    SelectCommand="SELECT p.[ID], p.[Name], p.[Email], l.[State], l.[City] FROM [Person] p, [Location] l WHERE p.[LocationID]=l.[ID] ORDER BY p.[Name]"
    UpdateCommand="UPDATE [Person] SET [Email] = @Email WHERE [ID] = @ID"
  /&gt;
  
  &lt;asp:GridView ID="myGridView" runat="server" DataSourceID="myDataSource" 
    AllowPaging="true" AllowSorting="true" PageSize="25" AutoGenerateEditButton="true"   
    DataKeyNames="ID"&gt;
    &lt;Columns&gt;
      &lt;asp:BoundField DataField="ID" Visible="false" /&gt;
      &lt;asp:TemplateField HeaderText="Person" SortExpression="Name"&gt;                                        
        &lt;ItemTemplate&gt;
          &lt;asp:Literal ID="nameLit" runat="server" Text='&lt;%# Bind("Name") %&gt;' /&gt;
        &lt;/ItemTemplate&gt;                                    
      &lt;/asp:TemplateField&gt;
      &lt;asp:BoundField DataField="Email" SortExpression="Email" HeaderText="Email Address" /&gt;
      &lt;asp:TemplateField HeaderText="Location" SortExpression="City"&gt;
        &lt;ItemTemplate&gt;
          &lt;asp:Literal ID="cityLit" runat="server" Text='&lt;%# Bind("City") %&gt;' /&gt;
          &lt;asp:Literal ID="stateLit" runat="server" Text='&lt;%# Bind("State") %&gt;' /&gt;
        &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;     
    &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>The data source has a lot of records. At least 25,000. Because of this, I want to allow the user to filter by state. I want to provide a drop down list with a list of states. When a user changes the drop down list, the results in the grid view will be filtered by the selected state. However, I do not know how to do this with a SqlDataSource. Can someone please explain to me how to accomplish this?</p>
  
  <p>Thank you!</p>