473,395 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 3671
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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
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...
0
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...

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.