468,248 Members | 1,533 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,248 developers. It's quick & easy.

2 DataGrids & Paging

In a shopping cart app, a ASPX page retrieves the order details &
personal details of a user from a MS-Access database table depending
upon the username of the user.

The order details of a particular order (like ProductID, Name,
Description, Quantity etc.) are displayed in one DataGrid where as the
personal details of the buyer corresponding to this order (like Name,
E-Mail, Shipping & Billing Address etc.) are displayed in another
DataGrid. Note that both the DataGrids reside in the same ASPX page.

Users can also place multiple orders. Under such circumstances, I want
to provide paging capability to the ASPX page that displays the 2
DataGrids. Assume that I have placed 5 orders & currently I am viewing
my 1st order. The 1st DataGrid displays the order details of my 1st
order & the 2nd DataGrid displays personal details corresponding to my
1st order. When I click the 2nd paging link, the 1st DataGrid should
display the order details of my 2nd order & the 2nd DataGrid should
display the personal details corresponding to my 2nd order.

The problem is if I provide paging in the 1st DataGrid & then click
the 2nd paging link to view my 2nd order & personal details, then the
1st DataGrid will correctly display the order details of my 2nd order
but the 2nd DataGrid will not correctly display the personal details
corresponding to my 2nd order.

The situation just reverses if I provide paging in the 2nd DataGrid
i.e. while viewing the details of my 1st order, if I click the 2nd
paging link to v;iew my 2nd order & personal details, then the 2nd
DataGrid will display the personal details of my 2nd order correctly
but the 1st DataGrid will not correctly display the order details
corresponding to my 2nd order.

What do I do in such a scenario?

Of course, I can do the paging manually but that would involve adding
a lot of extra code. I won't be able to use the in-built paging
feature of the DataGrid as well.

Please note that I would like to display the order details & personal
details in 2 different DataGrids only.

Apr 13 '07 #1
2 1662
Hi,
I guess you are using ASP.NET 1.1.
Since you have two grids with same number of records, it won't be difficult.
You can apply paging on 1st or 2nd or both the datagrids.
When ever a user clicks on page number a event is generated. Handle that
event. From there you'll get the NewPageIndex of the datagrid, set the same
index for the second grid also.

I hope this solves your problem. In case of any difficulty or problem feel
free to write back to me.

"rn**@rediffmail.com" wrote:
In a shopping cart app, a ASPX page retrieves the order details &
personal details of a user from a MS-Access database table depending
upon the username of the user.

The order details of a particular order (like ProductID, Name,
Description, Quantity etc.) are displayed in one DataGrid where as the
personal details of the buyer corresponding to this order (like Name,
E-Mail, Shipping & Billing Address etc.) are displayed in another
DataGrid. Note that both the DataGrids reside in the same ASPX page.

Users can also place multiple orders. Under such circumstances, I want
to provide paging capability to the ASPX page that displays the 2
DataGrids. Assume that I have placed 5 orders & currently I am viewing
my 1st order. The 1st DataGrid displays the order details of my 1st
order & the 2nd DataGrid displays personal details corresponding to my
1st order. When I click the 2nd paging link, the 1st DataGrid should
display the order details of my 2nd order & the 2nd DataGrid should
display the personal details corresponding to my 2nd order.

The problem is if I provide paging in the 1st DataGrid & then click
the 2nd paging link to view my 2nd order & personal details, then the
1st DataGrid will correctly display the order details of my 2nd order
but the 2nd DataGrid will not correctly display the personal details
corresponding to my 2nd order.

The situation just reverses if I provide paging in the 2nd DataGrid
i.e. while viewing the details of my 1st order, if I click the 2nd
paging link to v;iew my 2nd order & personal details, then the 2nd
DataGrid will display the personal details of my 2nd order correctly
but the 1st DataGrid will not correctly display the order details
corresponding to my 2nd order.

What do I do in such a scenario?

Of course, I can do the paging manually but that would involve adding
a lot of extra code. I won't be able to use the in-built paging
feature of the DataGrid as well.

Please note that I would like to display the order details & personal
details in 2 different DataGrids only.

Apr 15 '07 #2
On Apr 15, 9:52 am, Tushar <Tus...@discussions.microsoft.comwrote:
Hi,
I guess you are using ASP.NET 1.1.
Since you have two grids with same number of records, it won't be difficult.
You can apply paging on 1st or 2nd or both the datagrids.
When ever a user clicks on page number a event is generated. Handle that
event. From there you'll get the NewPageIndex of the datagrid, set the same
index for the second grid also.

I hope this solves your problem. In case of any difficulty or problem feel
free to write back to me.

"r...@rediffmail.com" wrote:
In a shopping cart app, a ASPX page retrieves the order details &
personal details of a user from a MS-Access database table depending
upon the username of the user.
The order details of a particular order (like ProductID, Name,
Description, Quantity etc.) are displayed in one DataGrid where as the
personal details of the buyer corresponding to this order (like Name,
E-Mail, Shipping & Billing Address etc.) are displayed in another
DataGrid. Note that both the DataGrids reside in the same ASPX page.
Users can also place multiple orders. Under such circumstances, I want
to provide paging capability to the ASPX page that displays the 2
DataGrids. Assume that I have placed 5 orders & currently I am viewing
my 1st order. The 1st DataGrid displays the order details of my 1st
order & the 2nd DataGrid displays personal details corresponding to my
1st order. When I click the 2nd paging link, the 1st DataGrid should
display the order details of my 2nd order & the 2nd DataGrid should
display the personal details corresponding to my 2nd order.
The problem is if I provide paging in the 1st DataGrid & then click
the 2nd paging link to view my 2nd order & personal details, then the
1st DataGrid will correctly display the order details of my 2nd order
but the 2nd DataGrid will not correctly display the personal details
corresponding to my 2nd order.
The situation just reverses if I provide paging in the 2nd DataGrid
i.e. while viewing the details of my 1st order, if I click the 2nd
paging link to v;iew my 2nd order & personal details, then the 2nd
DataGrid will display the personal details of my 2nd order correctly
but the 1st DataGrid will not correctly display the order details
corresponding to my 2nd order.
What do I do in such a scenario?
Of course, I can do the paging manually but that would involve adding
a lot of extra code. I won't be able to use the in-built paging
feature of the DataGrid as well.
Please note that I would like to display the order details & personal
details in 2 different DataGrids only.- Hide quoted text -

- Show quoted text -
Thanks Tushar for the idea. Actually I was supposed to use 2 DataGrids
but since I want the 2nd DataGrid to display records row-wise & not
column-wise (have a look at how I want to display the records at
http://rn5a.brinkster.net/Page1.aspx), I had to replace the 2nd
DataGrid with a DetailsView.

Any idea how do I go about paging under such circumstances?

Apr 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by ByB | last post: by
2 posts views Thread by Gavin | last post: by
reply views Thread by Jos Walrave | last post: by
9 posts views Thread by | last post: by
reply views Thread by Shock | last post: by
1 post views Thread by Craig G | last post: by
4 posts views Thread by Helen Trim | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.