1

我有一个 Devexpress XtraGrid,页脚中有一个总摘要单元格。

单元格显示正确,但其中没有任何值。我有: Grid.OptionsView.ShowFooter = trueGrid.OptionsBehavior.AutoUpdateTotalSummary = true

在我想要总和的列中 :Col.SummaryItem.FieldName = col.FieldNamecol.SummaryItem.SummaryType = Sumcol.SummaryItem.DIsplayFormat = ${0}

汇总单元格从不显示值。如果右键单击摘要单元格,然后选择求和,则会显示摘要值并正常工作。但是我需要在不需要用户右键单击单元格并选择 Sum 的情况下工作。任何帮助,将不胜感激。谢谢 :)

4

1 回答 1

0

以下代码对我来说很好,所以我认为你的源代码有问题:

using DevExpress.Data;
using DevExpress.XtraGrid;
//...
colUnitPrice.FieldName = "UnitPrice";
colUnitPrice.Name = "colUnitPrice";
colUnitPrice.Summary.AddRange(new GridSummaryItem[] {
    new GridColumnSummaryItem(SummaryItemType.Sum, "UnitPrice", "${0}")});

请再次检查您的源代码(不要忘记查看总摘要文章)或向我们提供有关此问题的更多详细信息。

于 2012-01-10T12:52:13.773 回答