Datagrids with checkboxes and postbacks...

  • Thread starter Thread starter Gavin
  • Start date Start date
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
 
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...
 
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
 
Back
Top