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 8181705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:36:44+00:00 2026-06-07T00:36:44+00:00

I am trying to implement a gridview with checkbox column on asp.net (VB). when

  • 0

I am trying to implement a gridview with checkbox column on asp.net (VB). when the user checks checkbox and click delete button, it should access database and delete all checked item.
I have already tried numerous googled solution and never worked for me. here is short scenario
on my aspx page:
1)search by id text box, when user enter ID and click search button, the below table is displayed

<asp:GridView ID="MyGridView" runat="server">
<Columns>
<asp:TemplateField headertext="Name">
<ItemTemplate>
<asp:Label id="namelbl" 
text='<%# Eval("name")%>' runat="server"/>
</ItemTemplate>   
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete Now?">
<ItemTemplate>
 <asp:CheckBox Enabled="true"   ID="chkStatus" runat="server" />

</ItemTemplate>      
</asp:TemplateField>
 </Columns>
 </asp:GridView>

after data is displayed, user checks the desired checkbox and click delete button, then the code behind is run

Protected Sub DelSelected(ByVal sender As Object, ByVal e As System.EventArgs)
Dim idList as ArrayList = new ArrayList()
For Each row As GridViewRow In MyGridView.Rows
    Dim selectcb As CheckBox = CType(row.FindControl("chkStatus"), CheckBox)
     If (selectcb.Checked) Then
     'put into delete list

Trouble starts here, selectcb checkbox is always false
How could that happen, any idea would be appreciated
Thanks

  • 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-06-07T00:36:46+00:00Added an answer on June 7, 2026 at 12:36 am

    you must bind your data only when no IsPostback in order to persist your checkbox selected, and no reset

    If(! IsPostBack)
    {
      Bind();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView on an ASP.NET page that I'm trying to bind to
I'm trying to figure out ASP.NET's GridView pagination mechanics so I can use the
I am trying to implement a checkbox within gridview, The job of this checkbox
Trying to implement LoaderManager + CursorLoader. In onFinish method adapter should swap its cursor
I have an asp.net page with a c# code-behind. I am trying to have
Hey guys, I have a question about asp.net I have this table with checkbox
I'm trying implement a bracket in my program (using C#/.NET MVC) and I am
so im trying to implement a lightbox on a gridview. the lightbox i'm using
I am using ASP.NET to create a page with a GridView that is very
I am trying to implement the GridView tutorial at: http://developer.android.com/resources/tutorials/views/hello-gridview.html However, I get the

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.