1.SmartDataGrid 的 ShowColumnFooters="True"
2.如果将其中一栏显示“合计”两个字,将对应列的 Footer="合计"
3.在需要合计的列增加合计,如
<smart:SmartDataColumn Header="金额" Binding="{Binding Amount}" Width="100" IsReadOnly="True">
<smart:SmartDataColumn.AggregateFunctions>
<smart:SumFunction />
</smart:SmartDataColumn.AggregateFunctions>
</smart:SmartDataColumn>
其中:<smart:SumFunction />是合计,还有其它几个统计的功能:
CountFunction,FirstFunction,LastFunction,MaxFunction,MinFunction
4. XXXFunction中有几个属性会常用:
Caption : 在统计内容前的标题
SourceField: 要统计的栏位,当要统计的栏位与列的Binding内容不一致,或列没Binding时,就要设置
ResultFormatString: 返回值的格式字符串,默认与Column中的DataFormatString一致