各种常用的WINFORM控件遍历

1:删除空白行

For Each row As DataGridViewRow In Me.dgvBloodSugarInfo.Rows
Dim isEmpty = True
For Each cell As DataGridViewCell In row.Cells
If cell.ColumnIndex > 0 And cell.Value IsNot Nothing Then
isEmpty = False
Exit For
End If
Next
If isEmpty Then
dgvBloodSugarInfo.Rows.Remove(row)
End If
Next

posted on 2012-09-25 12:25  疯狂的石头陈  阅读(259)  评论(0编辑  收藏  举报

导航