Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7416119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:25:32+00:00 2026-05-29T07:25:32+00:00

My problem is: I have a GridView, which is bound to list of declared

  • 0

My problem is:

I have a GridView, which is bound to list of declared DTO objects with column of CheckBoxes. Also, I have a “Save” button on the page. My mission concludes in getting all rows, where CheckBox is checked and get the containing data. Unfortunately, row.DataItem = null on Button1_Click, because, I’m using if(!IsPostBack) gw.DataBind() statement (otherwise, I can’t get CheckBox status). Could you give me the best practice for solving my problem?

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:25:33+00:00Added an answer on May 29, 2026 at 7:25 am

    If you do if(!IsPostBack) --> gw.DataBind(), that will reinitialize your GridView and the checkboxes will be set to unchecked again.

    In your case, in Button1_Click event, you can loop through each DataRow on your GridView and find the row which has it’s checkbox checked and get all the selected row data.

    foreach (GridViewRow gvRow in gw.Rows) {
    // Find your checkbox
        CheckBox chkBox = (CheckBox)gvRow.FindControl("checkBox");
    
        if (chkBox.Checked) {
        // Get your values 
            string value1 = gvRow.Cells[1].Text;
            string value2 = gvRow.Cells[2].Text;
            // etc...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView control on an ASP page, which I've bound to a
I have a gridview with some data bound to it. I also have different
I have a gridview which has an asp image-button for deleting a row. I
I have a bound field in my Gridview which is getting its value from
In my .aspx page, I have an <asp:GridView runat=server ID=CustomerGridView> control which I bind
I have an UpdatePanel containing a GridView which contains a button in the HeaderTemplate
I have problem regarding date in LINQ query which is binded to a gridview.
I have a GridView inside Scrolling div, which looks nice but the problem is
I have to display Datetime in my gridview, the problem is that while I
Problem: I have an address field from an Access database which has been converted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.