From: tshad on
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


From: Alvin Bruney - ASP.NET MVP on
Try setting the selected item back to -1

--
Vapordan
Shameless Author Plug
ASP.NET 4 by Example only $20
OWC Blackbook www.lulu.com/owc

"tshad" <t(a)dslextreme.com> wrote in message
news:##RwwUepKHA.1548(a)TK2MSFTNGP06.phx.gbl...
> 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
>