Hi!
I want to know, how to delete empty or blank row in DataGridView in Vb.net..........
"When i click Button the all empty or blank row in DataGridView will be remove......"
LIKE this :
" Before Button Clicked "
" After Button Clicked "
hhm_pro992
0
Newbie Poster
Recommended Answers
Jump to PostTry
For r As Integer = dgvMyGrid.Rows.Count - 1 To 0 Step -1 Dim empty As Boolean = True For Each cell As DataGridViewCell In dgvMyGrid.Rows(r).Cells If Not IsNothing(cell.Value) Then empty = False Exit For End If Next If empty Then dgvMyGrid.Rows.RemoveAt(r) Next
You want to …
All 4 Replies
Reverend Jim
4,561
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
OtepTheThird
0
Light Poster
Reverend Jim
4,561
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
hhm_pro992
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.