Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Navigating dataset in Web form
Message
 
To
14/01/2003 11:56:33
Gary Otte
California Youth Authority
Sacramento, California, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00741511
Message ID:
00741542
Views:
21
Hi Gary,

Because Web forms are stateless, there is no concept of BindingContext to know the current record in a DataSet. You need to keep track of that manually. If your DataView is small, you could keep the value in a Session variable and pass it to your Edit page. You could also save your DataViewRow index in a Session variable and that way you would know the next DataViewRow index to retrieve. To get the index, use DataGrid.SelectedIndex. If your DataView is too large, then just save your DataViewRow index and fetch the DataView again. Of course, this only works if your data does not have any new rows added.

>I want to include "Previous" and "Next" buttons on a Web form to allow the user to step through a dataset. I know how to set the Position property of the BindingContext object to accomplish this in a Windows app, but I can't seem to find the way to do this in a Web app.
>
>I'm retrieving the dataset from a Web service and binding it to a sortable datagrid. If the user clicks Edit on the grid, a second Web form displays all columns for that row. I want to allow the user to navigate to previous and next rows from there.
>
>TIA for any comments.
>
>Gary
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform