01.
private
void
button1_Click(
object
sender, EventArgs e)
02.
{
03.
string
strValue =
""
;
04.
List<
int
> rowsToDelete =
new
List<
int
>();
05.
{
06.
foreach
(DataGridViewRow row
in
dataGridView1.Rows)
07.
{
08.
DataGridViewCheckBoxCell checkBox = dataGridView1[0, row.Index]
as
DataGridViewCheckBoxCell;
09.
if
(checkBox !=
null
)
10.
{
11.
if
(Convert.ToBoolean(checkBox.Value) ==
true
)
12.
{
13.
strValue +=
";"
+ row.Cells[1].Value.ToString();
14.
15.
StreamWriter File =
new
StreamWriter(
"Test_File1.txt"
);
16.
File.Write(strValue);
17.
File.Close();
18.
}
19.
}
20.
}
21.
}
22.
}