如何实现GridView没数据但是字段的框架还在?
如何显示这个框架?
[解决办法]
if (dt.Rows.Count == 0)
{
dt.Rows.Add(dt.NewRow());
this.GridView1.DataSource = dt;
GridView1.DataBind();
int columnCount = GridView1.Rows[0].Cells.Count;
GridView1.Rows[0].Cells.Clear();
GridView1.Rows[0].Cells.Add(new TableCell());
GridView1.Rows[0].Cells[0].ColumnSpan = columnCount;
GridView1.Rows[0].Cells[0].Text = "无符合数据,请重新设定搜索条件. ";
GridView1.Rows[0].Cells[0].ForeColor = Color.Red;
}