C# Datagridview Checkbox Checked Event - multiple rows?

On button Click event do: static int SelectColumnIndex = 0; PerformAction_Click(object sender, System. EventArgs e) { string data = string. Empty; foreach(DataGridViewRow row in MyDataGridView.

Rows) { if(row. CellsSelectColumnIndex. Value!

=null && Convert. ToBoolean(row. CellsSelectColumnIndex.

Value) == true) { foreach(DataGridViewCell cell in row. Cells) { if(cell.OwningColumn. Index!

= SelectColumnIndex) { data+= (cell. Value + " ") ; // do some thing } } data+="\n"; } } MessageBox. Show(data, "Data"); }.

If you want the user to click on a button to perform the action, then what you need to handle is the Click event of the button, not the CheckBox Changed event... When the button is clicked, just go through all rows of your DataGridView and perform an action on rows with a checked checkbox.

Yes It works but we need to put some conditions to work in a way we like...

Static int SelectColumnIndex = 0; PerformAction_Click(object sender, System. EventArgs e) { string data = string. Empty; foreach(DataGridViewRow row in MyDataGridView.

Rows) { if(row. CellsSelectColumnIndex. Value!

= null && Convert. ToBoolean(row. CellsSelectColumnIndex.

Value) == true) { foreach(DataGridViewCell cell in row. Cells) { if (cell.OwningColumn. Index!

= SelectColumnIndex) { data+= (cell. Value + " ") ; // do some thing } } data+="\n"; } } MessageBox. Show(data, "Data"); }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions