473,385 Members | 1,343 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,385 software developers and data experts.

Gridview & Paging Question

Lee


Hello all,

Fairly new to .net. Using VB.net/2005

I am having a bit of trouble implementing a data driven gridview with
paging. I am binding the grid to a DataTable at runtime (which is
created on the fly) as opposed to setting up a datasource on the page,
etc. I create the datatable and then assign it to the gridview's
datasource property and call DataBind.

At first, I kept getting an error saying that there was no handler for
the PageIndexChanging event. Not sure why there HAS to be an event
handler for that. So, I created the handler and simply assigned:

e.Cancel = False

to it and no longer received the error. However, clicking on the next
page link in the gridview does nothing except post back the page. It
doesn't switch to next page.

Is it that I must use a "sited" datasource and dataset on the page to
get this to work?

Thanks for help.

--
Warm Regards,
Lee

"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."
Nov 29 '05 #1
2 1667
Try removing the "e.Cancel = False" code. The GridView requites the event
handler, but you don't have to execute any code within said event handler.

--

Andrew Robinson
www.binaryocean.com
www.bellinghamdotnet.org
"Lee" <lu*************@yahoo.com> wrote in message
news:%2*****************@TK2MSFTNGP12.phx.gbl...


Hello all,

Fairly new to .net. Using VB.net/2005

I am having a bit of trouble implementing a data driven gridview with
paging. I am binding the grid to a DataTable at runtime (which is
created on the fly) as opposed to setting up a datasource on the page,
etc. I create the datatable and then assign it to the gridview's
datasource property and call DataBind.

At first, I kept getting an error saying that there was no handler for
the PageIndexChanging event. Not sure why there HAS to be an event
handler for that. So, I created the handler and simply assigned:

e.Cancel = False

to it and no longer received the error. However, clicking on the next
page link in the gridview does nothing except post back the page. It
doesn't switch to next page.

Is it that I must use a "sited" datasource and dataset on the page to
get this to work?

Thanks for help.

--
Warm Regards,
Lee

"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."

Nov 29 '05 #2
Lee
Andrew Robinson enlightened me by writing:
Try removing the "e.Cancel = False" code. The GridView requites the
event handler, but you don't have to execute any code within said
event handler.


Thanks for responding. I have tried that, but same results.

--
Warm Regards,
Lee

"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."
Nov 29 '05 #3

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

Similar topics

0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
2
by: | last post by:
Hello, I have a GridView in my ASP.NET 2.0 application that performs the paging feature perfect when I have it bound to a data source. But now I have it bound to a dataset and the paging...
4
by: Bishop | last post by:
I want to find out if there is a way to use the gridview to list products simular to the listing on this page:...
1
by: davidjgonzalez | last post by:
I have a GridView that has paging enabled. Each item (as defined in an ItemTemplate) includes several controls which have operations i would like to Atlas-enable. Everything is working well except...
8
by: Greg Lyles | last post by:
Hi all, I'm trying to develop an ASP.NET 2.0 website and am running into some real problems with what I thought would be a relatively simple thing to do. In a nutshell, I'm stuck on trying to...
2
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
0
by: Don Miller | last post by:
Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the...
3
by: Ronald S. Cook | last post by:
I was told that if calling lots of records from the database (let's say 100,000), that the GridView's paging feature would automatically "handle" everything. But the 100,000 records are still...
4
by: Don Miller | last post by:
This is a repost of a reproducible problem/bug with GridView with dynamic SQL and binding. Is there a better ASP.NET newsgroup I should post to where MS techs or MVPs take an interest in such...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.