Show of Gridview Header with Empty Data Source
This is the method for showing the Header of GridView when no data returned in the query.
DataTable dt = new DataTable();
_conn = new DbConnection();
dt = _conn.ExecuteSelectQueryNoParam("select * from test");
if (dt.Rows.Count == 0)
{
DataRow dr = dt.NewRow();
dt.Rows.Add(dr);
}
GridView1.DataSource = dt;
GridView1.DataBind();
GridView1.Rows[0].Visible = false;