Mark Lampad

Mark Lampad

  • NA
  • 55
  • 704

rewrite Datagridview Code to Datagrid

Oct 28 2019 3:37 AM
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)