//页面加载 protected void Page_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof(System.Int32)); dt.Columns.Add("TopicCode", typeof(System.String)); dt.Columns.Add("PDFFile", typeof(System.String)); dt.Columns.Add("TopicName", typeof(System.String)); dt.Columns.Add("FacilityName", typeof(System.String)); dt.Columns.Add("Equipment", typeof(System.String)); dt.Columns.Add("UserRole", typeof(System.String)); dt.Columns.Add("AuditStatus", typeof(System.String)); dt.Columns.Add("ApprovedTime", typeof(System.String)); dt.Columns.Add("LeftTime", typeof(System.String)); dt.Columns.Add("EndDate", typeof(System.DateTime)); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); GridViewDetection.DataSource = dt; GridViewDetection.DataBind(); //int ColumnCount = this.GridViewDetection.Rows[0].Cells.Count; //this.GridViewDetection.Rows[0].Cells.Clear(); //this.GridViewDetection.Rows[0].Cells.Add(new TableCell()); //this.GridViewDetection.Rows[0].Cells[0].ColumnSpan = ColumnCount; //this.GridViewDetection.Rows[0].Cells[0].Text = "<center>No Records Found.</center>"; }
protected void Page_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof(System.Int32)); dt.Columns.Add("UserName", typeof(System.String)); dt.Columns.Add("Password", typeof(System.String)); dt.Columns.Add("Role", typeof(System.String)); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); GridViewDetection.DataSource = dt; GridViewDetection.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof(System.Int32)); dt.Columns.Add("ResultName", typeof(System.String)); dt.Columns.Add("FacilityName", typeof(System.String)); dt.Columns.Add("PaperName", typeof(System.String)); dt.Columns.Add("Writer", typeof(System.String)); dt.Columns.Add("Publication", typeof(System.String)); dt.Columns.Add("PublishDate", typeof(System.DateTime)); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); GridViewDetection.DataSource = dt; GridViewDetection.DataBind(); }