转:Show Header/Footer of Gridview with Empty Data Source
public void BuildNoRecords(GridView gridView, DataSet ds)
{
try {
if (ds.Tables(0).Rows.Count == 0) {
ds.Tables(0).Rows.Add(ds.Tables(0).NewRow());
gridView.DataSource = ds;
gridView.DataBind();
int columnCount = gridView.Rows(0).Cells.Count;
gridView.Rows(0).Cells.Clear();
gridView.Rows(0).Cells.Add(new TableCell());
gridView.Rows(0).Cells(0).ColumnSpan = columnCount;
gridView.Rows(0).Cells(0).Text = "No Records Found.";
}
} catch (Exception ex) {
}

相关文章:

  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2021-12-20
  • 2021-10-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2021-10-26
  • 2021-09-14
相关资源
相似解决方案