My web application has a aspx(C#) file which shows the report data in a grid view. the grid has first two coulmns fixed and columns 3 & onwards are dynamically generated.
What I want - A new row at the end of grid should be added dynamically which should display the total of each column 3 onwards.
Any help would be much appreciated.
If you need three dynamic columns total to be displayed then declare three Global valibales and In RowDataBound event try like this
If (e.Row.RowType = DataControlRowType.DataRow) Then
Variable1 += Integer.Parse(e.Row.Cells(2).Text)
Variable2 += Integer.Parse(e.Row.Cells(3).Text)
Variable3 += Integer.Parse(e.Row.Cells(4).Text)
Else (e.Row.RowType = DataControlRowType.Footer)
e.Row.Cells(2).Text = Variable1.Tostring()
e.Row.Cells(3).Text = Variable2.Tostring()
e.Row.Cells(4).Text = Variable3.Tostring()
If it solves your issue please mark this posting as "Answered".