Eric Eric - 23 days ago 7
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
protected void GridView1_DataBound(object sender, EventArgs e)
{
    if (this.GridView1.Rows.Count == 0)
      this.GridView1.Visible = false; 
}