Avatar of netsmithcentral
netsmithcentral
Flag 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

Look at the Totals positioning
ASP.NET

Avatar of undefined
Last Comment
netsmithcentral

8/22/2022 - Mon
kswathi

Can you please show the gird aspx also
netsmithcentral

ASKER
I am using the Obout Grid control.
Capture.JPG
godeschalk

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
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
netsmithcentral

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
netsmithcentral

ASKER
As stated in answer, solution was not addressed by any other post.