Link to home
Avatar of netsmithcentral
netsmithcentralFlag for United States of America

asked on

Grid Control Footer Totals in wrong position

I have a working Grid control where the footer displays column totals using the code behind file.  For some reason the positioning is off and some column totals are missing from the Grid.  I can't figure out what I did wrong in the code to cause this.

I attached both code and the resulting Grid.  Why are the totals misaligned?
Public Class Dashboard
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Dim TotalIssued As Integer = 0
    Dim TotalAssigned As Integer = 0
    Dim TotalComplete As Integer = 0
    Dim TotalRemaining As Integer = 0
    Dim TotalCancelled As Integer = 0

    Protected Sub RowDataBound(ByVal sender As Object, ByVal e As GridRowEventArgs)
        If e.Row.RowType = GridRowType.DataRow Then
            TotalIssued += Int32.Parse(e.Row.Cells(2).Text)
            TotalAssigned += Int32.Parse(e.Row.Cells(3).Text)
            TotalComplete += Int32.Parse(e.Row.Cells(4).Text)
            TotalRemaining += Int32.Parse(e.Row.Cells(5).Text)
            TotalCancelled += Int32.Parse(e.Row.Cells(6).Text)
        ElseIf e.Row.RowType = GridRowType.ColumnFooter Then
            e.Row.Cells(1).Text = "Total:"
            e.Row.Cells(2).Text = TotalIssued.ToString()
            e.Row.Cells(3).Text = TotalAssigned.ToString()
            e.Row.Cells(4).Text = TotalComplete.ToString()
            e.Row.Cells(5).Text = TotalRemaining.ToString()
            e.Row.Cells(6).Text = TotalCancelled.ToString()

        End If
    End Sub
End Class

Open in new window

User generated image
Avatar of kswathi
kswathi
Flag of India image

Can you please show the gird aspx also
Avatar of netsmithcentral

ASKER

I am using the Obout Grid control.
Capture.JPG
i copied your code and it works fine by me, but i did not use the folderstyle
So i would say try it without that, remove folderstyle
ASKER CERTIFIED SOLUTION
Avatar of netsmithcentral
netsmithcentral
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
As stated in answer, solution was not addressed by any other post.