Checkbox and Gridview

C

Chris McGrath

Hello all,

I have a gridview that contains a checkbox for each row and in each
row, one of the fields is an asp:HyperLinkField.

What I am trying to do is allow a user to click the link and have all
records in the same group be selected by setting the checkbox's to
checked for just that group.

Can this be done? And can someone point me in the right direction?

Thanks!
 
L

lee whitbeck

Hello all,

I have a gridview that contains a checkbox for each row and in each
row, one of the fields is an asp:HyperLinkField.

What I am trying to do is allow a user to click the link and have all
records in the same group be selected by setting the checkbox's to
checked for just that group.

Can this be done? And can someone point me in the right direction?

Thanks!

One way you could do this is by populating your gridview from a
dataset. The dataset contains all proper info needed to check or
uncheck your fields. You can then handle the user click, and re-
populate your dataset based on the user's selection. Finally, all that
you would need to do is rebind your gridview to the dataset
programatically.

Lee
 
C

Chris McGrath

Thanks. I have the grid populating the correct checkboxes now. The
issue I currently have is if a user clicks on more then one link, I
lose the values of the previously clicked link.
 
L

lee whitbeck

Thanks. I have the grid populating the correct checkboxes now. The
issue I currently have is if a user clicks on more then one link, I
lose the values of the previously clicked link.





- Show quoted text -

You could store the original dataset, and then allow the user to press
a "Restore" button, or something along those lines. Then all you would
have to do is rebind the grid with the original dataset vs the
modified one.
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top