Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

Gridview - Footer

I have a column call "Open Account". I want to display a total on a footer in Gridview. How can I accomplish this task - VB please.
Avatar of craskin
craskin
Flag of United States of America image

if you make the open account column a templated column, you can create your own footer template with a label in it, then on the gridview_bound event, do something like

Sub myGridViewDataBound(...) Handles myGridView.DataBound
   Dim Total as Single = 0    
   For each row as GridViewRow in myGridView.Rows
         Total += row.Cells(the integer of Open Account cell).Text
   Next
   CType(myGridView.FindControl("myTotalLabel"), Label).Text = Total
End Sub
           
ASKER CERTIFIED SOLUTION
Avatar of samtran0331
samtran0331
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial