Monday, January 2, 2012

How To Show the Header of GridView When Data Source is nothing

If ds.Tables(0).Rows.Count > 0 Then
    GdvAdd.DataSource = ds.Tables("AddTbl")
    GdvAdd.DataBind()
Else
   ds.Tables(0).Rows.Add(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
   GdvAdd.DataSource = ds.Tables("AddTbl")
   GdvAdd.DataBind()
   GdvAdd.Rows(0).Visible = False
End If

No comments:

Post a Comment