I would like to delete the empty rows from a column. Here is what I've tried but does not work, I am getting an error as "use 'new' keyword to create an object instance"!
Your help would be appreciated, thanks so much.
- For i= data.Rows.Count - 1 To 0 Step -1
-
- Dim row As DataGridViewRow = data.Rows(i)
-
- if (Not row.IsNewRow Andalso data.Rows(i).Cells(1).Value.Tostring() = "") Then
-
- data.Rows.RemoveAt(i)
-
- Else
- End If