我使用devexpress MVC Gridview显示结果,并使用数据摘要。默认情况下,数据摘要将应用于所有分组的列。我希望仅当我对一个特定列进行分组时才显示此数据摘要,并且应该对其余列隐藏此数据摘要。
假设我有四列,"ColumnA","ColumnB","ColumnC","ColumnD“。
数据汇总应仅对"ColumnA“可用,当我对ColumnB、C或D分组时,不应显示这些列的数据汇总。
发布于 2014-12-10 19:49:55
尝试此解决方案
[AttributeUsage(AttributeTargets.Property,Inherited= true,AllowMultiple = false)]
public class SummaryColumnAttribute : Attribute
{
public SummaryColumnAttribute(SummaryItemType summaryItemType,bool showGroupsummary,bool showTotalSummary)
{
this.SummaryItemType = summaryItemType;
this.ShowGroupSummary = showGroupsummary;
this.ShowTotalSummary = showTotalSummary;
}
}
并在model类中应用以下内容
[SummaryColumnAttribute(DevExpress.Data.SummaryItemType.Sum, true, true)]
public decimal OpeningBalance { get; set; }
https://stackoverflow.com/questions/24051930
复制相似问题