I have checkbox in datagridview view.
It is databound using procedure
I want to add items on selection.
It works well on first selection and adding.
But again when I add error of this type
Object cannot cast from dbnull null to other types occur.
I use bool isselected
foreach (DataGridViewRow row in dgvProductdiscount.Rows)
{
decimal disc = 0;
decimal discper = 0;
bool isSelected = false;
isSelected = Convert.ToBoolean(row.Cells["chkbox"].Value);
if (isSelected)
if ((Convert.ToBoolean(row.Cells["chkbox"].Value) == true))-----here i get errror
{
}