title: GridView Filtering with ObjectDataSource using Custom Paging
body: <p>I have a Gridview and an Object DataSource that works fine for Sorting and Paging.</p>
  
  <p>Defined as; </p>
  
  <pre><code>&lt;asp:ObjectDataSource runat="server" ID="oPagedData" SelectMethod ="GetPagedData" TypeName="PagedSortableGridView" EnablePaging="true" SelectCountMethod="GetTotalOfData" 
      SortParameterName="sortExpression" &gt;
      &lt;/asp:ObjectDataSource&gt;
  </code></pre>
  
  <p>I want to add in filtering, so that I can take the value from a Text Box and a Check box, and apply this to my data (which is retrieved via entlib).</p>
  
  <p>If I add </p>
  
  <pre><code>    &lt;FilterParameters&gt;
           &lt;asp:formparameter name="Name" formfield="tags" defaultvalue="%%" Type="string" /&gt;
           &lt;asp:formparameter name="showArchived" formfield="showArchived" defaultvalue="false" /&gt;
      &lt;/FilterParameters&gt;
  </code></pre>
  
  <p>into the ObjectDataSource then it all compiles fine. But I can't see how I then access those parameters in my linq code.</p>
  
  <p>(I have tried adding a params array, or the 2 explicit params to the method call that retrieves the
   <code>data public List&lt;Dealerships&gt; GetPagedData</code>
  , but then when I browse to that page it fails as it is expecting a method call with only 3 params, the sort column, rows per page, and current index.)</p>
  
  <p>So do I need to define another another method call in the ods for filtering, or is there a way of accessing the filtering in the <code>GetPagedData</code> method so i can retireve and page my data all in one go? </p>
  
  <p>I looked into using </p>
  
  <pre><code>oPagedData_Filtering(object sender, ObjectDataSourceFilteringEventArgs e)
  </code></pre>
  
  <p>but that is expecting to sit on my code behind, not in the <code>PagedSortableGridView</code> Class with my <code>GetTitalData</code> and <code>GetPagedData</code> methods.</p>