need help with GridView and a DataSet

Posted on 2006-06-01
Medium Priority
Last Modified: 2011-09-20

I have a gridview that is has its datasource set to a DataSet.

Each row in the grid has checkbox. When the checkbox is unchecked/checked I need to update it rows in the DataSet.

I assume i will need to store the DataSet in  a session object and update that each time the checkbox is clicked.

Then when i hit the "save" button i can check the ((DataSet)Session["DataSet"]).HasChanges() and make the correct database calls with the new values.

Struggling to get this figured out and do it correctly!!

Thanks for your help!
Question by:jrmcdona
  • 2

Accepted Solution

Dnx_7 earned 2000 total points
ID: 16815825
why aren't programming the button click?

ok you have a gridview and checkbox column

you can do that on button_Click

dim chk as checkbox
for each row as gridviewrow in gridview.rows
chk = ctype(row.findcontrol('idcheckbox'), checkbox)
if chk.checked then
update table
end if
next row

databind the gridview with a new select from database


Expert Comment

ID: 16820697
thank you for the grade :)


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses
Course of the Month16 days, 2 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question