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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:23:23+00:00 2026-05-27T22:23:23+00:00

The GridView is bound to an Access Table, but I want to update the

  • 0

The GridView is bound to an Access Table, but I want to update the checkbox using the asp:ButtonField. The best I’ve been able to do is replace the checkbox with a string value. Below is the code I have now:

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
    If e.CommandName = "check" Then
        'Enable Editing on the GridView
        GridView1.EditIndex = GridView1.SelectedIndex
        'Assign value to the row selected
        Dim index As Integer = Convert.ToInt32(e.CommandArgument)
        'Assign selected gridview row
        Dim selectedRow As GridViewRow = GridView1.Rows(index)
        'Assign checkbox cell as table cell
        Dim selectedCell As TableCell = selectedRow.Cells(0)

        'Assign a value to the checkbox, **but instead is replacing the checkbox**
        selectedCell.Text = "True"
    End If
End Sub
  • 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-27T22:23:23+00:00Added an answer on May 27, 2026 at 10:23 pm

    I think you need to use .FindControl().

    The GridViewCell is not the same thing as a CheckBox control inside it. You code should probably look more like:

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "check" Then
            'Enable Editing on the GridView
            GridView1.EditIndex = GridView1.SelectedIndex
            'Assign value to the row selected
            Dim index As Integer = Convert.ToInt32(e.CommandArgument)
            'Assign selected gridview row
            Dim checkBox As CheckBox = GridView1.Rows(index).FindControl("checkBoxIdGoesHere")
    
            checkBox.Checked = true 'or false or whatever based on your command.
        End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView bound to a table using BindingSource and Linq to SQL
I'm using an EntityDataSource in an asp .net form and a Gridview is bound
I'm binding my gridview's bound columns with datafield using the column name of my
We're using a WPF GridView that is dynamically bound to a DataTable (which in
i have a GridView bound to a DataView. Some columns in the DataView's table
You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages.
I have an EntityDataSource bound to many filters used by gridview data, I want
I have a fairly big asp.net website that use GridView bound to the same
I've got an ASP.NET GridView bound to an ObjectDataSource where columns are not automatically
I am using a Devexpress 9 gridview which is bound to a datasource. 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.