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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:36:15+00:00 2026-05-26T11:36:15+00:00

I have a datagridview with multiple checkboxes. When the Finished checkbox is checked I

  • 0

I have a datagridview with multiple checkboxes. When the Finished checkbox is checked I need to execute linq code to update a specific table. How do I find out if that specific check box is dirty and where do I write the code to pass the values I need to be passed to the table. Note that it is not the same table that the datagridview is based on.

Thanks.

EDIT:

 private void propertyInformationDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {
        DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)propertyInformationDataGridView.Rows[e.RowIndex].Cells[3];

        DataGridViewRow row = propertyInformationDataGridView.Rows[e.RowIndex] as DataGridViewRow;

        System.Data.DataRowView SelectedRowView;
        newCityCollectionDataSet.PropertyInformationRow SelectedRow;

        SelectedRowView = (System.Data.DataRowView)propertyInformationBindingSource.Current;
        SelectedRow = (newCityCollectionDataSet.PropertyInformationRow)SelectedRowView.Row;

        if (Convert.ToBoolean(checkCell.EditedFormattedValue) == true)
        {
            DataClasses1DataContext dc = new DataClasses1DataContext();

            var matchedCaseNumber = (from c in dc.GetTable<PropertyInformation>()
                                     where c.CaseNumberKey == SelectedRow.CaseNumberKey
                                     select c).SingleOrDefault();

            reportsSent newReport = new reportsSent();
            newReport.CaseNumberKey = SelectedRow.CaseNumberKey;
            dc.reportsSents.InsertOnSubmit(newReport);
            dc.SubmitChanges();

        }
    }

Do I need to endedit at some point is that the issue?

  • 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-26T11:36:16+00:00Added an answer on May 26, 2026 at 11:36 am

    This is from some of my code, all you need to do is create a “CellContentClick” event for your datagridview.

    The easiest way to do this is select the Datagridview, go to properties and click on the lightning bolt. Scroll down to “CellContentClick” and double click in the empty box. This will auto generate the method you need to paste the following code into.

    Make sure you rename my instances of “CustomersDataGridView” to whatever yours is named as well, intellisense should highlight invalid code in red that you need to replace.

    Also, the “9” you see in the checkCell declaration needs to be changed to the index of your “Finished” check-box. If it is in the 3rd cell from the left, put a 2 there instead of a 9, as the indexing is 0 based.

    EDITTED to fix comments:

    private void CustomersDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {
    
        if (e.ColumnIndex.ToString() == "9")
        {
            DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)CustomersDataGridView.Rows[e.RowIndex].Cells[9];
            DataGridViewRow row = CustomersDataGridView.Rows[e.RowIndex] as DataGridViewRow;
    
            if (Convert.ToBoolean(checkCell.EditedFormattedValue) && CustomersDataGridView.IsCurrentCellDirty)
            {
                //Do Work here.
                var z = row.Cells[0].Value; // Fill in the brackets with the column you want to fetch values from
                //z in this case would be the value of whatever was in the first cell in the row of the checkbox I clicked
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have datagridview and need to update it on separate thread. Or maybe even
I have readonly datagridview, I need in some specific case enable one cell after
I have a datagridview made up of multiple rows and columns. I want to
I have a DataGridView with one DataGridViewComboBoxColumn in my WinForms application. I need to
I have a DataGridView that I want to query using Linq (C# WinForm). I
I have a DataGridView binded to this table: [Users] ID Name -- ---- 11
I have a DataGridView bound to a LINQ to SQL query expression. I want
I have a datagridview on a form with multiple columns. Three of the columns
I need to have multiple lines in a cell, so I use DataGridViewTextBoxColumn.DefaultCellStyle.WrapMode =DataGridViewTriState.True.
I have a DataGridView that is populated with 4 columns and multiple rows of

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.