This example show when we use GridView and there is functionality Edit.Delete and Add New row using footer row.
If there is no record in database so it good to display a runtime emplty grid.
call this method like this...
Ds = objempBLL.GetEmp();
if (Ds.Tables[0].Rows.Count > 0)
{
gridview.DataSource = Ds;
gridviewDataBind();
}
else
{
ShowNoResultFound(Ds, gridview);
}
private void ShowNoResultFound(DataSet ds,GridView gv)
{
DataTable dt = (DataTable)ds.Tables[0];
dt.Rows.Add(dt.NewRow());
gv.DataSource = dt;
gv.DataBind();
int TotalColumns = gv.Rows[0].Cells.Count;
gv.Rows[0].Cells.Clear();
gv.Rows[0].Cells.Add(new TableCell());
gv.Rows[0].Height = 0;
gv.Rows[0].Visible = false;
}