Single record display paging through dataset

A

Alan Z. Scharf

1. I have a web form with several textboxes. I want the form to display one
record at a time from a multiple-row dataset. No datagrid is invloved

2. I want the user to be able to page through the records, one record at a
time, with Next and Previous buttons at the botton, identical to how an
Access form would work with a multiple-record query as its data source.

3. I have been looking in docs, books, and articles for an example of this,
which would show both

(a) how to databind each textbox to the multiple-record set, and
(b) how to negotiate the next/previous records

However I have not been able to find such an example.

Any help or reference to an example would be appreciated.

Thanks.

Alan
___________________________
Alan Z. Scharf
GrapeVine Systems
New York City
 
A

Alan Z. Scharf

Lewis,

Thanks so much for your detailed answer. I'll be able to try it out
tomorrow.
Would you mind telling me why don't you like using datagird? I think it's
relatively easy to do that.

1. I do have a datagrid with just a few of the main fields from a SQL table.

2. I want the user to be able to double-click on any of the datagrid records
and open up another page that displays all the fields for that record in a
vertical layout, single record view.

3. I also want the user to be able to use next/previous links at the bottom
of the single-record page to "thumb through" the records one at a time ,
stepping through each dataset record.

4. This is very easy to do in Access, and I'm trying to duplicate an
existing Access application in a web application.

Regards,

Alan
 
L

Lewis Wang [MSFT]

Hi Alan,

Thank you for your feedback, I see what you mean.

I still recommend you use datagird, as I believe it's better.

You can bind the dataset to datagrid and set it's AllowPaging to true,
PageSize=1, EditItemIndex=0. You also can set some properties in the
propertybuilder of the datagrid. At last, you need to add a
PageIndexChanged event to datagrid, and write a code similar to the
following:

private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
DataSet ds=(DataSet)Session["ds"];
DataGrid1.DataSource =ds.Tables [0];
DataGrid1.CurrentPageIndex =e.NewPageIndex;
DataGrid1.DataBind();
}

By the way, if you modify the single-record and update database, don't
forget to modify the dataset or reload it from database, because the
dataset is in session. Otherwise, you will find the single-record does not
change after you have modified it.

If you need more information, please let me know. Thanks.

Lewis Wang
Support Professional

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Reply-To: "Alan Z. Scharf" <[email protected]>
| From: "Alan Z. Scharf" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Single record display paging through dataset
| Date: Wed, 23 Jul 2003 00:03:11 -0400
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3718.0
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3718.0
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 207-237-205-129.c3-0.nyw-ubr2.nyr-nyw.ny.cable.rcn.com
207.237.205.129
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:13351
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
|
|
| Lewis,
|
| Thanks so much for your detailed answer. I'll be able to try it out
| tomorrow.
|
| > Would you mind telling me why don't you like using datagird? I think
it's
| > relatively easy to do that.
|
| 1. I do have a datagrid with just a few of the main fields from a SQL
table.
|
| 2. I want the user to be able to double-click on any of the datagrid
records
| and open up another page that displays all the fields for that record in a
| vertical layout, single record view.
|
| 3. I also want the user to be able to use next/previous links at the
bottom
| of the single-record page to "thumb through" the records one at a time ,
| stepping through each dataset record.
|
| 4. This is very easy to do in Access, and I'm trying to duplicate an
| existing Access application in a web application.
|
| Regards,
|
| Alan
|
|
|
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top