Datagrids with checkboxes and postbacks...

G

Gavin

Hi,

I am trying to get a list of all of the rows in a datagrid where a
checkbox is checked but am having a major headache with the postback.

I'm using VB and codebehind and I have an example which works fine as
long as I don't repopulate the datagrid. Unfortunately I need to
repopulate the datagrid to get the paging and sorting to work.

So I have one option where the grid's datasource is refreshed as part
of the page_load and this lets the in grid buttons and paging and
sorting all work fine. Unfortunately the selecting doesn't work unless
I don't do the rebinding in the page_load. Can I make the page_load
check what operation caused the postback or have I just got the whole
of this backwards?

Any help would be great as I'm stuck and going around in circles.

Cheers,

Gav
 
J

Jos

Gavin said:
Hi,

I am trying to get a list of all of the rows in a datagrid where a
checkbox is checked but am having a major headache with the postback.

I'm using VB and codebehind and I have an example which works fine as
long as I don't repopulate the datagrid. Unfortunately I need to
repopulate the datagrid to get the paging and sorting to work.

So I have one option where the grid's datasource is refreshed as part
of the page_load and this lets the in grid buttons and paging and
sorting all work fine.

Why do you want to do this refreshing in page_load?
I would suggest doing it in the event handler (when that option is
selected).

I hope this helps...
 
G

Gavin

Why do you want to do this refreshing in page_load?
I would suggest doing it in the event handler (when that option is
selected).

I hope this helps...

Thanks for the suggestion, I got it sorted by moving the refresh logic
around.

Now it only calls the refreshes in the initial load and in various
events and it all works fine.

Thanks again for your help

G
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top