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

Home Posts Topics Members FAQ

Datagrid and Pagging

Hi,
I'm using a Datagrid that I fill with a Dataset but
when I configure the paging with the Navigation Buttons I
can't put them working, I've tried both methods (Next,
Previous and Page Numbers) when I click on the Next link
of the navigation buttons I see on status bar the
folowing code -> javascript:__doPostBack('Datagrid1$_ctl9
$_ctl1','') but nothing happens on Datagrid.

I've configured the datagrid for 5 rows and Dataset
returns about 20 rows.

Thanks in advance
Ric
..
Jul 19 '05 #1
2 3674
You have to handle the page changing event in the datagrid, and write your
own code to advance to the next page.

"Ricardo Manuel" <an******@hotmail.com> wrote in message
news:05****************************@phx.gbl...
Hi,
I'm using a Datagrid that I fill with a Dataset but
when I configure the paging with the Navigation Buttons I
can't put them working, I've tried both methods (Next,
Previous and Page Numbers) when I click on the Next link
of the navigation buttons I see on status bar the
folowing code -> javascript:__doPostBack('Datagrid1$_ctl9
$_ctl1','') but nothing happens on Datagrid.

I've configured the datagrid for 5 rows and Dataset
returns about 20 rows.

Thanks in advance
Ric
.

Jul 19 '05 #2
Just because you've changed the DataGrid's interface to support or "Enable"
paging, doesn't mean that the functionality is automatic, it just means that
you'll have the buttons (or hyperlinks) that a user can click. You still
must write the code for the PageIndexChanged event that fires when someone
clicks the paging button (or hyperlink).

See code below (by the way the same concept is true when you enable sorting
in the DataGrid - - I've included that code as well):

Private Sub dg_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
dg.PageIndexChanged
dg.CurrentPageIndex = e.NewPageIndex
dg.DataBind()
End Sub

Private Sub dg_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
dg.SortCommand
Dim dv As New DataView(dsCusts.Tables(0))
dv.Sort = e.SortExpression
dg.DataSource = dv
dg.DataBind()
End Sub

"Ricardo Manuel" <an******@hotmail.com> wrote in message
news:05****************************@phx.gbl...
Hi,
I'm using a Datagrid that I fill with a Dataset but
when I configure the paging with the Navigation Buttons I
can't put them working, I've tried both methods (Next,
Previous and Page Numbers) when I click on the Next link
of the navigation buttons I see on status bar the
folowing code -> javascript:__doPostBack('Datagrid1$_ctl9
$_ctl1','') but nothing happens on Datagrid.

I've configured the datagrid for 5 rows and Dataset
returns about 20 rows.

Thanks in advance
Ric
.

Jul 19 '05 #3

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

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
2
by: sushil bogam via .NET 247 | last post by:
(Type your message here) hi there please help me with datagrid control i want to add a checkbox in datagrid and also want to trap the check bok check or click event and also want to maintain the...
7
by: Dave | last post by:
Are there any add-on products or samples available that can do the following in an vb.net datagrid I want to compare 2 rows in a datagrid - one row from one database and another row for another...
5
by: Ricardo Manuel | last post by:
Hi, I'm using a Datagrid that I fill with a Dataset but when I configure the paging with the Navigation Buttons I can't put them working, I've tried both methods (Next, Previous and Page Numbers)...
0
by: chittu07 | last post by:
Hi, I am sending my code ,my query is running right but in the pagging the content(data) of last page are display on first page so when ever next button is clicked no data are displaying ...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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
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 ...
0
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.