0

Hi there,
I have a question in datagrid view , hwat I want is when a user edits a datagridview cell in a row in the datagridview I want to check a check box in the same row, how can I do this and what is the event that I have to write the code in???

Thankx in avvance

3
Contributors
2
Replies
5
Views
7 Years
Discussion Span
Last Post by Geekitygeek
0

I think the event you will want to use is CellEndEdit. here is an example
where the datagridview is named dgvMetrics.

private void dgvMetrics_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow dgvr = dgvMetrics.Rows[e.RowIndex];
            dgvr.Cells["chkbx"].Value = true
        }

you can reference the cell by its index position or it name which in this case is chkbx

0

If you are ever unsure about which event to use you can always check the msdn reference for the class/control you are using. It has a very comprehensive list of the events and when they are raised:

CellEndEdit: Occurs when edit mode stops for the currently selected cell.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.