Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete empty row in a gridview

Status
Not open for further replies.

Injun

IS-IT--Management
Dec 17, 2002
30
US
Code:
dv = New DataView(ds.Tables(0))
GridView1.DataSource = dv
GridView1.DataBind()
Dim bIsGridEmpty As Boolean = True
For j As Integer = 0 To GridView1.Rows.Count - 1
If GridView1.Rows(j).Cells(0).Text <> String.Empty Then
bIsGridEmpty = False
GridView1.DeleteRow(j)
'GridView1.Rows(j).Visible = False
' GridView1.Rows(j).Controls.Clear()
End If

GridView1.DeleteRow(j) is not working.No errors. But The row is still showing.
If cell(0) is empty then I wanto delete the entire row. Anything more I need to do?
Thanks for the help
(Rate)
 
Have you stepped through your code? Does the DataSource contain the row after you call the DeleteRow function? Have you tried rebinding the GridView after you deleted the Row?


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top