Help regarding Checkbox event in datagridview
-
Hi All, in one (windows)form im binding the table to datagridview ,with check box column . if i click check box in one column , i want to display the content of that row in a new window ... in which event we have to write the code .., give me samples or tell me how to write ..!! thanks .
-
Hi All, in one (windows)form im binding the table to datagridview ,with check box column . if i click check box in one column , i want to display the content of that row in a new window ... in which event we have to write the code .., give me samples or tell me how to write ..!! thanks .
Hi, You can use the CellEndEdit() event for DataGridView. You can probably take a look at the given code. Lets say we have a grid with first column as boolen column. You have another form2 with a property GetDataRow() to receive the DataGridView row. In this scenario, you can put the following code under CellEndEdit() event.
if (e.ColumnIndex == 0) { DataRow dr; if (DataGridView1(e.ColumnIndex, e.RowIndex).Value == false) { Form2 frm = new Form2(); frm.GetDataRow = DataGridView1.Rows[e.RowIndex];//Property on Form2 which accepts the row frm.ShowDialog(); } }
I hope this helps. Regards,Allen Smith Software Engineer ComponentOne LLC www.componentone.com
-
Hi, You can use the CellEndEdit() event for DataGridView. You can probably take a look at the given code. Lets say we have a grid with first column as boolen column. You have another form2 with a property GetDataRow() to receive the DataGridView row. In this scenario, you can put the following code under CellEndEdit() event.
if (e.ColumnIndex == 0) { DataRow dr; if (DataGridView1(e.ColumnIndex, e.RowIndex).Value == false) { Form2 frm = new Form2(); frm.GetDataRow = DataGridView1.Rows[e.RowIndex];//Property on Form2 which accepts the row frm.ShowDialog(); } }
I hope this helps. Regards,Allen Smith Software Engineer ComponentOne LLC www.componentone.com