Eric Eric - 1 year ago 114
ASP.NET (C#) Question

Hide Gridview

i have a Gridview that has filters that can fire off the emptydata template. However when this is displayed I can still see the outline of my gridview. How can I make the Gridview disappear when the data is not present?

Answer Source
protected void GridView1_DataBound(object sender, EventArgs e)
    if (this.GridView1.Rows.Count == 0)
      this.GridView1.Visible = false; 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download