I'm traversing a DataTable
with a foreach
using a variable of type DataRow
, however I'm having to retrieve the index of the DataRow
I'm traversing.
foreach(DataRow row in DataTable.Rows)
{
string descricao = Convert.ToString(row["id"] +" - "+ row["nome"]);
int index = ??;
int value = Convert.ToInt32(row["id"]);
checkedListBoxControl1.Items.Add(value);
checkedListBoxControl1.Items[index].Description = descricao;
}