Paging using Gridview and ObjectDataSource

T

tshad

I have a GridView that I page using ObjectDataSource:

<asp:ObjectDataSource ID="ObjectDataSource1" EnablePaging="true"
runat="server" SelectCountMethod="GetRowCount"
SelectMethod="BindControl" TypeName="DAO"
StartRowIndexParameterName="startRowIndex"
MaximumRowsParameterName="maximumRows">
</asp:ObjectDataSource>


This works fine and my paging it done on the Server instead of letting the
GridView handle it so I get only the data I need.

The problem is that if a dropdown is changed, I need to change the
parameters I send to the server including reseting the page number.

Right now what happens is that the page number will be the same as it was
when I last bound the Grid. So if the last page I was on was 4, the next
time I bind it will also be 4.

How do I change it back to 1?

Is that done from ObjectDataSource or the GridView?

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top