How would i go about checking if a row’s cells have data in them, ie not empty/null.
I’ve been trying the following:
if (dgvClient.SelectedRows.Count > 0)
{
DataGridViewRow currentRow = dgvClient.SelectedRows[0];
if (currentRow.Cells.ToString() != String.Empty)
{
//The code that will be here will open a form
}
else
{
MessageBox.Show("Select a non null row");
}
}
However, it doesn’t appear to be working, and I’m out of ideas :/
Thanks for any help,
Ari
.Cellsis a collection ofDataGridViewCellobjects.You need to iterate through that collection & test each cell to see if it has a value…