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
190
Last row value in summary
posted

Hi,

Please let me know how do I get the last row value in the summary. for example I have a column

 

----------------------------

                      Balance

----------------------------

                           1000

                           2300

                           3100

                             540

-----------------------------

Closing Bal:       540

-----------------------------

 

Please let me know how do I achieve this.

 

Thank you,

Irfan

 

 

Parents Reply
  • 190
    posted in reply to Mike Saltzman

    Hi,

    This is the scenario I have, what I need is the highlighted cell value in the Balance column as summary for 'Closing Bal'.

     

    This is the code I use for this.

    -----------------------------------------------------------------------------------------------------------------------------

        Private Sub uwg_InitializeLayout_1(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles uwg.InitializeLayout

            e.Layout.Bands(0).Summaries.Clear()
            e.Layout.Bands(0).Summaries.Add("Summary", Infragistics.Win.UltraWinGrid.SummaryType.Formula, Me.uwg.DisplayLayout.Bands(0).Columns("Balance"), Infragistics.Win.UltraWinGrid.SummaryPosition.UseSummaryPositionColumn)

            e.Layout.Bands(0).Summaries("Summary").Formula = "" ' No formula Yet

            e.Layout.Bands(0).Summaries("Summary").DisplayFormat = "Closing Bal= {0}"

        End Sub

    -------------------------------------------------------------------------------------------------------------------------------

     

    Further when I tried to use find the value in the last row cell like this

    uwg.Rows(uwg.Rows.Count - 1).Cells("Balance").Value

    I am end up with Null Reference Exception.

     

    Please let me know the possible work around,

     

    Thank you,

    Irfan

     

     

Children