2
Answers

rewrite Datagridview Code to Datagrid

Photo of Mark Lampad

Mark Lampad

5y
846
1
How to rewrite this code for Datagrid?
 
int sw1 = 0;
ids = string.Empty;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (dataGridView1[0, i].Value != null)
{
if (sw1 == 0)
{
sw1 = 1;
}
else
ids += ",";
ids += dataGridView1[0, i].Value.ToString();
}
}

Answers (2)