Some time when we adding new row in gridview footer column and there is no record in database,so what we can do?
So we can disply message no record found and add new button show for adding new record.
Here is solution display runtime empty gridview.
private void ShowNoResultFound(DataSet ds,GridView gv)Thanks & Regards
{
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;
}
Santosh Singh
0 comments:
Post a Comment