473,487 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataGrid won't page

Hi,

I have a DataGrid which is populated by a DataAdapter getting data
from a stored procedure (on SQL Server 2k).

I've set the DataGrid to be pageable, and when I view the page in IE,
the paging controls come up, as does the correct data. However, when I
use the paging controls, it doesn't page to the next data.

I'm guessing that I'll need to change something to do with cursors,
but I'm reasonably new to .net programming, so I was wondering if
anyone could point me in the right direction?

Thanks in advance

Richard
Nov 16 '05 #1
1 1661
Hi,

you need to trap the PageIndexChanged event of the grid and set the
CurrentPageIndex property of the grid as follows: -

private void mygrid_PageIndexChanged(object source,
DataGridPageChangedEventArgs e)
{
mygrid.CurrentPageIndex = e.NewPageIndex;
BindGrid();
}

See the article in
http://msdn.microsoft.com/library/de...lesortable.asp
for more details.

Regards
Joyjit

"Richard Thomas" <ri************@bigfoot.com> wrote in message
news:84**************************@posting.google.c om...
Hi,

I have a DataGrid which is populated by a DataAdapter getting data
from a stored procedure (on SQL Server 2k).

I've set the DataGrid to be pageable, and when I view the page in IE,
the paging controls come up, as does the correct data. However, when I
use the paging controls, it doesn't page to the next data.

I'm guessing that I'll need to change something to do with cursors,
but I'm reasonably new to .net programming, so I was wondering if
anyone could point me in the right direction?

Thanks in advance

Richard

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3663
by: Fabrizio | last post by:
Hi, I created an aspx page with a Datagrid control that should list a bunch of records from a MS Access database table. When I load the page on Web Server , the datagrid itself is not visible....
2
2228
by: Max | last post by:
Is it possible or more effecient to use a stored procedure to populate a datagrid when using datagrid or custom paging? Is it (ADO.NET?) pulling the entire table into the dataset or is it just...
1
1167
by: Brad Simon | last post by:
Hi all, First of all, what just happened to the Datagrid discussions? Second, I have posted this one before, and I still can't fix this. I am using a datagrid to display paged data. Whenever...
2
2014
by: Marty McDonald | last post by:
When setting certain datagrid properties with the IDE (as in the property window), they don't seem to take effect. For instance, Font Name. So I have to set these via code-behind at the cell...
7
1981
by: Scott Schluer | last post by:
Hi All, I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to...
7
2427
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
2
1101
by: Chris Kennedy | last post by:
I have two datagrids on a page. On the update event of the first I take some of the selected data, create a dataset and add it and then bind it to the second datagrid. If I hit update several...
2
3169
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
12
1983
by: Daniel Walzenbach | last post by:
Hi, I want to display a Label in a DataGrid according to some condition. I therefore check whether the condition is true in the ItemDateBound EventHandler of the DataGrid. Unfortunately the...
2
2203
by: Mark Rae | last post by:
I've inherited an ASP.NET app and have been asked to fix the following problem with a page which is used to display and/or delete records from a database. When the page loads, it displays a list of...
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.