WebGrid bind to ObjectDataSource problem with customPagging and filtering

11 replies. Last post: August 9, 2011 9:18 PM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hello,

I bind WG to ObjectDataSource ,

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"  EnablePaging="true"
           MaximumRowsParameterName="maximumRows" SelectCountMethod="GetAllCount"
            SelectMethod="GetData" TypeName="ObjectDataSourceFilteringSample.DataItem">
            <SelectParameters>
                <asp:Parameter Name="FilterExpression" Type="String" />
                 </SelectParameters>
        </asp:ObjectDataSource>


Pagging works almost perfect but when I go to second page ( from first to second or from third to second it doesn't matter) rows in change don't change , number of page change, when I click RefreshData button all rows disappear. I check selectMethod it return correct rows, and in another function where is another pagging logic also second page doesn't show proper no matter of page size.

public List<Item> GetData(string FilterExpression, int startRowIndex, int maximumRows, string sortExpression)


Second problem is filtering with customPagging. Parameter FilterExpression is always null, I don't know how to pass what users type in web.

I attach a simple solutions with both issue.

Sample Code

All times are GMT -5. The time now is 8:44 AM.
Previous Next