contactsHandled = (string)dvData.Rows.Cells["scallshandled"];
and the code I had posted:
contactsHandled = (int) dvData.Rows.Cells["scallshandled"].Value;
1. I'm accessing the Value property of the DataGridViewCell. You are just accessing the DataGridViewCell.
2. I'm casting the value into integer since I'll be storing the value into contactsHandled which is an integer. You are casting the DataGridViewCell into a string and trying to store it into an integer.
When attempted with the changes it runs into this error:
there was an error - System.InvalidCastException: Specified cast is not valid.