Hi,
I have added a dropdown control (with populated data) called cboCustIDs to the first column of the datagridview dgv control.
The dgv is populated with columns such as CustIDs, ValueDate, etc...
I can also add new records inside the dgv.
There is a save button on the form which I want it to save the data in the dgv into the database.
So, I am looping through the rows of the dgv to get the data in the dgv as follows.
For each row, I would like to get the ID value of the item in cboCustIDs which is in the first column of the dgv.
How is this done in the loop please?
Thanks
foreach (DataGridViewRow row in dgv.Rows)
{
int intcboCustIDsColumn = dgv.Columns[cboCustIDs"].Index;
//????get the Values..
int intCustID = int.Parse(dgv[intcboCustIDsColumn, row.Index].Value.ToString());
}