Q:

GridView Filtering with ObjectDataSource using Custom Paging

I have a Gridview and an Object DataSource that works fine for Sorting and Paging.
Defined as; 
<asp:ObjectDataSource runat="server" ID="oPagedData" SelectMethod ="GetPagedData" TypeName="PagedSortableGridView" EnablePaging="true" SelectCountMethod="GetTotalOfData" 
    SortParameterName="sortExpression" >
    </asp:ObjectDataSource>

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).
If I add 
    <FilterParameters>
         <asp:formparameter name="Name" formfield="tags" defaultvalue="%%" Type="string" />
         <asp:formparameter name="showArchived" formfield="showArchived" defaultvalue="false" />
    </FilterParameters>

into the ObjectDataSource then it all compiles fine. But I can't see how I then access those parameters in my linq code.
(I have tried adding a params array, or the 2 explicit params to the method call that retrieves the
 data public List<Dealerships> GetPagedData
, 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.)
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 GetPagedData method so i can retireve and page my data all in one go? 
I looked into using 
oPagedData_Filtering(object sender, ObjectDataSourceFilteringEventArgs e)

but that is expecting to sit on my code behind, not in the PagedSortableGridView Class with my GetTitalData and GetPagedData methods.

A:

Add the explicit parameters to your GetPagedData and GetTotalOfData methods, and use the SelectParameters rather than the FilterParameters on the ObjectDataSource.

