need help with GridView and a DataSet

Posted on 2006-06-01
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
    LVL 2

    Accepted Solution

    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

    LVL 2

    Expert Comment

    thank you for the grade :)


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now