Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
295
Override Footer for Total Column
posted

I'm trying to override the footer of a column to enter in a grand total. The grid is grouped by a column and I want to be able to plug in a grand total under the final group total. I have seen some posts/documentation on creating mutliple rows in the footer, but it involves javascript and knowing the index of the columns you want totaled. I was hoping to resolve this through code behind. I can get it to work, but it adds a "Grand Total" line for all group totals. I only want it to add it to the last one. I have code snippets below.. How can I get a handle to the column footer in the last group total to be able to add in a grand total? The columns in the grid can change, so the index of the column to be totaled is always changing. What's not changing is the datakey name of the column. Thanks in advance!!

<igtbl:UltraGridColumn Width="110px" IsBound="false" Format="$###,###.00" Key="mCostBasisWReInvest" BaseColumnName="mCostBasisWReInvest" HeaderText="Total Cost" DataType="Double">

<HeaderStyle HorizontalAlign="Right" Wrap="true" />

<CellStyle HorizontalAlign="Right"></CellStyle>

<Footer Total="Sum"></Footer>

<FooterStyle HorizontalAlign="Right" Font-Bold="true"/>

</igtbl:UltraGridColumn>

Private Sub uwgHoldings_InitializeFooter(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.FooterEventArgs) Handles uwgHoldings.InitializeFooter

_nfsRunningRowCount += e.Rows.Count

If _nfsRunningRowCount = _nfsRowCount Then

e.Rows.Band.Columns.FromKey("mCostBasisWReInvest").Footer.Caption = "99,999.99" & "<br><br>" & _totalNFSAssets

End If

End Sub

 

Parents
  • 2211
    posted

    Hello pmdaniel99,

    Miss read your post. I would recommend creating a hierarchical structure; each band will have its own total, effectively giving you sub and grand totals.

    Patrick

     

Reply Children