Hi staydnet;
the below code show a grid view with no data in a grid; create a empty DataTable and bind it to
GridView. e.g:
sing System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("Name");
dt.Columns.Add("Description");
dt.Rows.Add(new object[] { "", "" });
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
Syed Shakeer Hussain
Satyadnet, if this helps please login to Mark As Answer. | Alert Moderator