kevin Thomas

kevin Thomas

  • NA
  • 1
  • 5.2k

ASP.NET Gridview Databind

Jul 12 2010 9:31 AM

I have written the following code to databind a gridview control on an asp website. When I step through the code the dataview shows that it had rows and columns the databind method executes but the gridview is not visible on my webpage.
if (!IsPostBack)
{
DataSet ds = GetData();
if (ds.Tables.Count > 0)
{
DataView dv = new DataView(ds.Tables[0]);
GridView1.DataSource = dv;
GridView1.Visible =
true;
GridView1.DataBind();
}
}

Answers (2)