check and uncheck function in datagridview in c#

Total Post:104


 1984  View(s)
Rate this:
Hi every one,

I'm working on datagridview in windows form. I have used checkbox in our gridview. I have successfully added checkbox and it generated for every rows. But this check box not check and uncheck. Can you tell me functionality of check and unchecked  of checkbox ?

Thank in advanced
  1. Re: check and uncheck function in datagridview in c#

    Hi Marcel Ethan

    You can used below code

    private void dgvControl_CellClick(object sender, DataGridViewCellEventArgs e)
          if ((Convert.ToBoolean(dgvControl[0, e.RowIndex].Value) == false))
                            dgvControl.Rows[e.RowIndex].Cells["ckbSelect"].Value = true;
                            dgvControl.Rows[e.RowIndex].Cells["ckbSelect"].Value = false;

    I hope above code solve your problem.

      Modified On Mar-29-2018 06:07:22 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.