find checkbox value of datagridview in windows aplication RRS feed

  • Question

  • I have datagridview in windows application with five fields.

    first column contain check box.If i checked on one of check box i don't get value of checkbox on CellContentEvent.

    this gridview bind in various condition.the problem is previous value assing to chececk box i.e  false.if i click on check box i didn't get check box value as true it gives me value false only .....

    I write code as follows to check checkbox


    if (e.ColumnIndex == 0) //CheckBox is the 3rd Column in DataGrid


     if (dataGridView1.Rows[e.RowIndex] .Cells[e.ColumnIndex].Value !=null )


     if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "true")


    string str = (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());




    what is another way to get value of check box in datagriview.




    Friday, April 11, 2008 9:37 AM

All replies