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

  • Home
  • SEARCH
  • 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 4543112
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:29:08+00:00 2026-05-21T15:29:08+00:00

I have a GridView in ASP.net where I have a CheckBox column. The user

  • 0

I have a GridView in ASP.net where I have a CheckBox column. The user can toggle the CheckBox. Now, what I want is that when the user clicks on a button, all the records from the GridView where the CheckBox is checked should be displayed. And on another button, the opposite state should be displayed…
I am not getting the logic for the same.

Can anyone please help me with the logic..

  • 1 1 Answer
  • 1 View
  • 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-21T15:29:08+00:00Added an answer on May 21, 2026 at 3:29 pm

    You could iterate through the GridViewRows and check if the CheckBox is checked using something like the following

    Edit from comments, fixed small bugs. Thanks guys. (3/20/2013):

    foreach (GridViewRow row in yourGridViewID.Rows)
    {
        CheckBox check = (CheckBox)row.FindControl("CheckBoxName");
    
        if (check.Checked)
        {
            //Take Row information from each column (Cell) and display it
        }
        else
        {
            //Display in seperate area
        }
    }
    

    The index is going to be the column number starting from 0, going left to right of which column holds the CheckBox. You need to make sure the CheckBox has an ID name which is used at CheckBoxName. If you don’t have an ID for that, you can also use

    CheckBox check = (CheckBox)row.Cells[index].Controls[0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Checkbox template column in a ASP.NET 3.5 GridView. Now the user
I have a ASP.NET GridView with a column mapped to a boolean. I want
I have a ASP.NET GridView that uses template columns and user controls to allow
I have a GridView control in an Asp.net application, that has a <asp:buttonField> of
I have an ASP.NET GridView which has columns that look like this: | Foo
I have an gridview that I am adding onclick events to a checkbox column
I have a GridView control on my ASP.NET page that binds to result set
I have a custom gridview control that extends the standard asp.net gridview control. The
i have a databound GridView in asp.net 2.0 with a row-selection link. When a
I have confusion about GridView in ASP.NET. How does the GridView exactly work? I

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.