I am currently developing an application in C# where I need to read the values of the cell of each row in a DataGridView in C#.
foreach (DataGridViewRow row in tblCategories.Rows)
{
string folderPath = tblBackups.Rows[row].Cells[5].Value.ToString();
string backupIncludes = tblBackups.Rows[row].Cells[4].Value.ToString();
Console.WriteLine("Folder Path: " + folderPath);
Console.WriteLine("Backup Includes: " + backupIncludes);
}
For some reason, this is not working.
I managed to find out the problem for myself.
I changed the code to the following:
Thanks for your help