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
1440
Hide Summary When Count = 0
posted

Hello

My wingrid contains a summary for the count of column 1 in band 1. What I want is to hide the entire summary line when the column being counted contains a specific string value.  My code shows continues to show the summary row when the specific string value is true.  What am I missing?

Thanks

Clay Seifert

            Dim WTs As UltraDataRowsCollection = dr.GetChildRows("WorkTickets")
            Dim wtsummary As SummarySettingsCollection

           If WT("ProductName") <> "No Work Tickets have been assigned to this case." Then
                wtsummary = ug1.DisplayLayout.Bands(1).Summaries
                For Each SS As SummarySettings In wtsummary
                    SS.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
                    ug1.DisplayLayout.Bands(1).Override.SummaryDisplayArea = SS.SummaryDisplayArea
                Next
            Else
                wtsummary = ug1.DisplayLayout.Bands(1).Summaries
                For Each SS As SummarySettings In wtsummary
                    SS.SummaryDisplayArea = SummaryDisplayAreas.None
                    ug1.DisplayLayout.Bands(1).Override.SummaryDisplayArea = SS.SummaryDisplayArea
                Next
            End If

 

Parents
  • 469350
    Offline posted

    Hi,

    I'm not sure what you are trying to do here. You're Your code is setting the SummaryDisplayArea on the the Override for the Band. So this will obvious affect the entire band and all summaries in the grid, not just one particular summary.

    Is that what you want?

    If so, then this seems like it should work okay, although it seems pretty confusing and I imagine there are much simpler ways to do it. The code here is incomplete, though, so it's hard to read. WT is not defined and I don't know what event this code is being called from.

Reply
  • 1440
    posted in reply to Mike Saltzman

    Hi Mike

    OK -- lets try this again.  Sorry that I wasn't clear in my initial post.

    My wingrid contains only one summary calculation for the count of column 1 in band 1. What I want is to hide the entire summary line when the column being counted contains a specific string value (See below).  When it doesn't contain the value, I want it to contain the "Total Work Tickets:" display. 

    Here is the complete code for the loading of the band 1 in the grids ultrawindatasourse.

                Dim WTs As UltraDataRowsCollection = dr.GetChildRows("WorkTickets")

                If WorkTicketsForCase.Count > 0 Then
                    For Each WorkTicket In WorkTicketsForCase
                        Dim WT As UltraDataRow = WTs.Add
                        WT("WorkTicket") = WorkTicket.WorkTicket
                        WT("ProductName") = WorkTicket.ProductName
                        WT("ProductNumber") = WorkTicket.ProductNumber
                        WT("SerialNumber") = WorkTicket.SerialNumber
                    Next

                    Dim wtsummary As SummarySettingsCollection = ug1.DisplayLayout.Bands(1).Summaries

                    For Each SS As SummarySettings In wtsummary
                        SS.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
                        ug1.DisplayLayout.Bands(1).Override.SummaryDisplayArea = SS.SummaryDisplayArea
                    Next

                Else
                    Dim WT As UltraDataRow = WTs.Add
                    WT("WorkTicket") = ""
                    WT("ProductName") = "No Work Tickets have been assigned to this case."
                    WT("ProductNumber") = ""
                    WT("SerialNumber") = ""

                    Dim wtsummary As SummarySettingsCollection = ug1.DisplayLayout.Bands(1).Summaries

                    For Each SS As SummarySettings In wtsummary
                        SS.SummaryDisplayArea = SummaryDisplayAreas.None
                        ug1.DisplayLayout.Bands(1).Override.SummaryDisplayArea = SS.SummaryDisplayArea
                    Next

                End If

    I used this approach based upon the recommendation in the following post.  http://blogs.infragistics.com/forums/t/32441.aspx

    I hope that this gives you what you need to provide assistance.

    Thanks

    Clay Seifert

Children