Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add the footer row dynamically in gridview. with textboxes [closed]

how to add the footer row dynamically in gridview. with textboxes.. pls give any idea...

like image 825
Innova Avatar asked Jun 28 '10 09:06

Innova


1 Answers

Since there can be only one footer row in the grid view IMO it is better to add the footer row by setting the ShowFooter property of the grid view to true. Setting the FooterStyle property can be helpful here.

When coming to the programming part,

protected void MyGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.Footer)
    {            
    TextBox txt = new TextBox();
          // set properties of text box
    e.Row.Cells[0].Controls.Add(txt);
    }
}

Try this and comment.

Edit : This will be helpful http://www.asp.net/data-access/tutorials/displaying-summary-information-in-the-gridview-s-footer-cs

like image 186
Kavinda Gayashan Avatar answered Oct 01 '22 06:10

Kavinda Gayashan