我有一個簡單的Devexpress
Gridview
。在Devexpress Gridview中計算小計
這裏代碼;
<dx:ASPxGridView ID="grid" runat="server" DataSourceID="MasterDataSource" Width="100%"
AutoGenerateColumns="False" KeyFieldName="CategoryID">
<Columns>
<dx:GridViewDataTextColumn FieldName="CategoryID" ReadOnly="True" VisibleIndex="0" />
<dx:GridViewDataTextColumn FieldName="CategoryName" VisibleIndex="1" />
<dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="2" />
</Columns>
<SettingsDetail ShowDetailRow="True" ExportMode="Expanded" />
<Templates>
<DetailRow>
<dx:ASPxGridView ID="detailGrid" runat="server" AutoGenerateColumns="False" DataSourceID="DetailDataSource"
KeyFieldName="ProductID" Width="100%" OnBeforePerformDataSelect="detailGrid_BeforePerformDataSelect">
<SettingsDetail IsDetailGrid="true" ExportIndex="0" />
<Columns>
<dx:GridViewDataTextColumn FieldName="ProductID" ReadOnly="True" VisibleIndex="0" />
<dx:GridViewDataTextColumn FieldName="ProductName" VisibleIndex="1" />
<dx:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="2" />
<dx:GridViewDataTextColumn FieldName="QuantityPerUnit" VisibleIndex="3" />
</Columns>
</dx:ASPxGridView>
有什麼辦法計算的DevExpress子總Unit Price
列?
對於這個例子;我只想在底部總計Unit Price
列(18 + 19 + 4.5 + 14 + 18 + 263.5 + 18 + 46 + 14 + 14 + 15 = 430
)..
我該怎麼做?
最好的問候,
Soner
@Özgür謝謝,但我想知道我怎麼能做到這一點在ASPxGridview ..應該是不同的正常Gridview。 – 2011-03-20 20:08:51