how to show footer when there is no data in gridview for inserting data from footer.
The easiest way to do this is to bind an array with a length of one. You can put anything in it you like to identify that this is a dummy row. On your GridViews RowDataBound method check to see if the data item is the dummy row (make sure the RowType is a DataRow first before trying to check the data). If it is the dummy row set the rows visibility to false. The footer and header should now be showing without any data.
Make sure you set the ShowFooter property to true on your GridView.
eg.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostback)
{
myGrid.DataSource = new object[] {null};
myGrid.DataBind();
}
}
protected void myGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DataItem == null)
{
e.Row.Visible = false;
}
}
}
Dears i was writing in my blog about this issue but for c# , you can review the post and check if it will be helpful or not ,
http://blog.waleedmohamed.net/2009/04/show-grid-view-header-and-footer-when.html
i was using a generic way with an helper to retrieve an empty list to fill the gird please check and if u have any quest don't hesitate to contact me or ask it on stack site