C# wpf网格列添加列的摘要
我有一个网格,其中有一个项目列表。清单中的一项是价格。 假设您在这个列表中有5个项目,我需要价格的总和,但它也需要显示在列表中C# wpf网格列添加列的摘要,c#,wpf,list,devexpress,C#,Wpf,List,Devexpress,我有一个网格,其中有一个项目列表。清单中的一项是价格。 假设您在这个列表中有5个项目,我需要价格的总和,但它也需要显示在列表中 <dxg:GridControl Grid.Row="1" SelectionMode="Row" ItemsSource="{Binding Temp}" dependencyProperties:BestFitColumn.IsEnabled="True" SelectedItems="{Binding SelectedTemp}"> <dxg:G
<dxg:GridControl Grid.Row="1" SelectionMode="Row" ItemsSource="{Binding Temp}" dependencyProperties:BestFitColumn.IsEnabled="True" SelectedItems="{Binding SelectedTemp}">
<dxg:GridControl.Columns>
<dxg:GridColumn Header="{x:Static meta:MetaCommon.Price}" FieldName="PriceDisplay"/>
</dxg:GridControl.Columns>
由于代码的大小,我对其进行了精简。最好的方法是在列表中创建包含汇总价格的项目,还是有办法将汇总添加到页脚中?
<dxg:GridControl.TotalSummary>
<dxg:GridSummaryItem FieldName="Price" SummaryType="Sum"/>
</dxg:GridControl.TotalSummary>
这应该是您要找的。更多信息请点击此处:
如何设置DataGrid的ItemsSource?