I have a Grid with LevelCount=2 and a SummaryArea. But the SummaryColumns are only shown for Level=1. What can I do ?
Hansjörg
Hi Hansjörg,
I'm afraid I do not understand what you mean. What's a SummaryColumn?
Levels don't have anything to do with summaries, really. Summaries are laid out in as many rows as needed regardless of the LevelCount.
Hi Mike,
Row 1 100
5
Row 2 200
7
Summary 12
This is shown in the Grid. My Code for the summary is:
e.Layout.Override.SummaryFooterSpacingAfter = 5 e.Layout.Override.SummaryFooterAppearance.BackColor = Color.Gold e.Layout.Override.SummaryFooterAppearance.BorderColor = Color.Silver e.Layout.Override.SummaryDisplayArea = SummaryDisplayAreas.TopFixed e.Layout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False Dim _Px_B As SummarySettings Dim _Px_M As SummarySettings For _i = 1 To 6 _Px_B = e.Layout.Bands(0).Summaries.Add(SummaryType.Sum, e.Layout.Bands(0).Columns("CT_BETRAG" & _i.ToString("0"))) _Px_B.Key = "CT_BETRAG" & _i.ToString("0") _Px_B.DisplayFormat = "{0:#,##0.00}" _Px_B.Appearance.BackColor = Color.Gold _Px_B.Appearance.BorderColor = Color.Silver _Px_B.Appearance.TextHAlign = HAlign.Right _Px_B.Appearance.TextVAlign = VAlign.Middle _Px_M = e.Layout.Bands(0).Summaries.Add(SummaryType.Sum, e.Layout.Bands(0).Columns("CT_MENGE" & _i.ToString("0"))) _Px_M.Key = "CT_MENGE" & _i.ToString("0") _Px_M.DisplayFormat = "{0:#,##0.00}" _Px_M.Appearance.BackColor = Color.Gold _Px_M.Appearance.BorderColor = Color.Silver _Px_M.Appearance.TextHAlign = HAlign.Right _Px_M.Appearance.TextVAlign = VAlign.Middle Next
I don't know what's wrong.
I'm still not following you. The code you have here is setting the summaries to TopFixed. So why does your representation at the top have them at the bottom? Is that the problem you are asking about?
It also appears that you are creating 12 summaries and your representation only shows one summary and 2 columns. Is that the issue?
Perhaps you can create a small sample project demostrating what you mean and explain what you are trying to accomplish?
I made a testset. You need a form named 'From12' and a ultragrid named 'UltraGrid1'. I use VB 2005 and Infragistics 7.3,
Public Class Form12 Private Sub Form12_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim _dt As New DataTable _dt.Columns.Add("MENGE", GetType(Double)) _dt.Columns.Add("BETRAG", GetType(Double)) ' _dt.Rows.Add(1, 10) _dt.Rows.Add(2, 20) ' UltraGrid1.DataSource = _dt End Sub Private Sub UltraGrid1_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout e.Layout.Bands(0).LevelCount = 2 ' e.Layout.Bands(0).GroupHeadersVisible = False e.Layout.Bands(0).Groups.Add("MB") ' e.Layout.Bands(0).Columns("MENGE").Group = e.Layout.Bands(0).Groups("MB") e.Layout.Bands(0).Columns("MENGE").Level = 0 e.Layout.Bands(0).Columns("BETRAG").Group = e.Layout.Bands(0).Groups("MB") e.Layout.Bands(0).Columns("BETRAG").Level = 1 ' e.Layout.Override.SummaryFooterSpacingAfter = 5 e.Layout.Override.SummaryFooterAppearance.BackColor = Color.Gold e.Layout.Override.SummaryDisplayArea = SummaryDisplayAreas.TopFixed e.Layout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False ' Dim _Px_MENGE As SummarySettings _Px_MENGE = e.Layout.Bands(0).Summaries.Add(SummaryType.Sum, e.Layout.Bands(0).Columns("MENGE")) ' Dim _Px_BETRAG As SummarySettings _Px_BETRAG = e.Layout.Bands(0).Summaries.Add(SummaryType.Sum, e.Layout.Bands(0).Columns("BETRAG")) End SubEnd Class
thanks for the solution, works fine.
Hm. Okay, I see the problem now.This might be a bug. The grid should probably be able to recognize that the two columns are in the same logical column and their summaries need to stack.
But since the grid is not recognizing this, you can work around it very easily, but aligning both summaries to the same column. So all you need to do is set the SummaryPositionColumn of the second summary to the first column. Like so:
Dim _Px_MENGE As SummarySettings _Px_MENGE = e.Layout.Bands(0).Summaries.Add(SummaryType.Sum, e.Layout.Bands(0).Columns("MENGE")) ' Dim _Px_BETRAG As SummarySettings _Px_BETRAG = e.Layout.Bands(0).Summaries.Add(SummaryType.Sum, e.Layout.Bands(0).Columns("BETRAG")) ' I added this line _Px_BETRAG.SummaryPositionColumn = e.Layout.Bands(0).Columns("MENGE")