Gridview & Paging Question

L

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..."
 
A

Andrew Robinson

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.
 
L

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..."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top