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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:12:21+00:00 2026-06-05T07:12:21+00:00

When user unchecks the checkbox for the datagridview row, messagebox displayed, if the user

  • 0

When user unchecks the checkbox for the datagridview row, messagebox displayed, if the user answers yes the row is deleted, if the user answers no then I need to re-check the check box. however it doesn’t actually check unless i click anywhere on the datagridview afterwards. Any ideas to get the dgv to updated?

Private Sub DataGridView2_CellValueChanged(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView2.CellValueChanged

  If e.RowIndex <> -1 Then
    Dim row As DataGridViewRow = DataGridView2.Rows(e.RowIndex)
    If e.ColumnIndex = 0 Then
      If row.Cells(0).Value = False Then
        If MessageBox.Show("Delete view from database.", "Delete", MessageBoxButtons.YesNo) = DialogResult.Yes Then
          DataGridView2.Rows.RemoveAt(e.RowIndex)
        Else
          row.Cells(0).Value = True
          DataGridView2.Invalidate()
        End If
      End If
    End If
  End If
End Sub

Private Sub DataGridView2_CurrentCellDirtyStateChanged(sender As Object, e As EventArgs) Handles DataGridView2.CurrentCellDirtyStateChanged
  If DataGridView2.IsCurrentCellDirty Then
    DataGridView2.CommitEdit(DataGridViewDataErrorContexts.Commit)
  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-06-05T07:12:23+00:00Added an answer on June 5, 2026 at 7:12 am

    Instead of Invalidate(), try calling RefreshEdit(), like this:

    Else
      row.Cells(0).Value = True
      DataGridView2.RefreshEdit()
    End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code to check a checkbox when user presses any key. However
I have a WPF application, where when a user unchecks a checkbox, the application
I need that when i check a checkbox i apply different background color to
Problem: user made some selection in the multi-selection listbox, then pressed a checkbox, and
User is a model. I have 100 users. I need to present the list
User Region Points Last_Updated 1 5 0 1-Nov-09 I want this row 2 1
Ok, the first column in my datagridview is a checkbox. I have 'multiselect' set
each checkbox that i check, i fill the input with it's id now, how
What i want is that when a user click a checkbox in otherwords uncheck
I have a fieldset with the option checkboxToggle:true . When the user checks/unchecks 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.