【问题标题】:How can I show a summary in the footer of a win grid and not have the Sigma show up in the header?如何在获胜网格的页脚中显示摘要而不在页眉中显示 Sigma?
【发布时间】:2012-05-13 10:31:48
【问题描述】:

我正在使用 Infragistics UltraWinGrid,并希望能够显示几列的总和。我通过允许行摘要来实现这一点。但是,我只希望他们能够看到总和,而不是拥有所有其他疯狂的选项以及标题中的那个小 sigma。如何在将总和保持在底部的同时摆脱这种情况?

【问题讨论】:

    标签: sum infragistics ultrawingrid


    【解决方案1】:

    您应该以这种方式设置 DisplayLayout.Override.AllowRowSummaries 属性:

    DisplayLayout.Override.AllowRowSummaries = AllowRowSummaries.Default;
    

    然后使用这样的代码来创建您的摘要 (在创建另一个同名摘要之前需要检查)

    private void BuildCurrencySummary(string name, UltraGridColumn col)
    {
        SummarySettings ss = grd.DisplayLayout.Bands[0].Summaries.Add(name, SummaryType.Sum, col);
        ss.SummaryPositionColumn = col;
        ss.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
        ss.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;
        ss.Appearance.ForeColor = Color.Black;
        ss.Appearance.TextHAlign = HAlign.Right;
        ss.DisplayFormat = "{0:C}";
    }
    

    【讨论】:

    • UltraGridColumn 还公开了一个 AllowRowSummaries 属性,以便您可以启用或禁用单个列上的 sigma 图标。
    • @alhalama,谢谢从来没有关注过这个。哦,有时该网格中的属性数量是压倒性的
    • 完美!只是因为我对你的措辞有点困惑,我自己想向未来的读者说明:应该是 DisplayLayout.Override.AllowRowSummaries = AllowRowSummaries.Default;
    【解决方案2】:

    来自Infragistics Forum

    您仍然可以在不设置 AllowRowSummaries 属性的情况下将摘要应用于列。

    AllowRowSummaries 的目的是显示(或不显示)用户建立自己的摘要的界面。这是您看到的“sigma”符号。

    从 Override 对象中,将 AllowRowSummaries 属性设置为 False。

    UltraGrid1.DisplayLayout.Override.AllowRowSummaries = Infragistics.Win.UltraWinGrid.AllowRowSummaries.[False]
    

    【讨论】:

      猜你喜欢
      • 2013-05-30
      • 2013-05-22
      • 1970-01-01
      • 1970-01-01
      • 2013-01-31
      • 2016-06-25
      • 1970-01-01
      • 2012-05-15
      • 1970-01-01
      相关资源
      最近更新 更多