jeudi 16 juin 2016

c# How to Syn dataGridView checkbox with textBox

How can i get the checkbox value and display it on textBox when i check a checkbox on datagrideview if i don't use the button click event?

I have try this:

        foreach (DataGridViewRow row in dataGridView1.Rows)
        {
            if (Convert.ToBoolean(row.Cells[1].Value) == true)
                textBox1.Text = Convert.ToString(row.Cells[1].Value);
        }

There is a problem that when i check the checkbox, the textbox don't show anything at the first time. When I click another checkbox, the textbox then show the value "true" on the textbox.




Aucun commentaire:

Enregistrer un commentaire