aspnet-devexpress-dot-web-dot-aspxcardviewsummarydisplaytexteventargs.md
Gets a summary item whose value is being processed.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public ASPxCardViewSummaryItem Item { get; }
Public ReadOnly Property Item As ASPxCardViewSummaryItem
| Type | Description |
|---|---|
| ASPxCardViewSummaryItem |
An ASPxCardViewSummaryItem object that represents the summary item whose value is being processed.
|
The following example calculates a summary in the CategoryID column based on the value in the ASPxSpinEdit below it.
When an end user changes a spin editor value, the editor sends a custom callback to the server in the client-side NumberChanged event handler. In the server-side SummaryDisplayText event handler, the grid calculates the summary value and sets it to the e.Text parameter.
<dx:ASPxCardView ID="ASPxCardView1" KeyFieldName="CategoryID" ClientInstanceName="grid"
OnSummaryDisplayText="ASPxCardView1_SummaryDisplayText"
AutoGenerateColumns="False"DataSourceID="AccessDataSource1" runat="server">
<Settings ShowSummaryPanel="True" />
<Columns>
<dx:CardViewTextColumn FieldName="CategoryID" ReadOnly="True" />
<dx:CardViewTextColumn FieldName="CategoryName" />
<dx:CardViewTextColumn FieldName="Description" />
</Columns>
<TotalSummary>
<dx:ASPxCardViewSummaryItem FieldName="CategoryID" SummaryType="Sum" />
</TotalSummary>
</dx:ASPxCardView>
<dx:ASPxSpinEdit ID="ASPxSpinEdit1" runat="server" Number="0" Height="21">
<ClientSideEvents NumberChanged="function(s, e) {
grid.PerformCallback();
}" />
</dx:ASPxSpinEdit>
protected void ASPxCardView1_SummaryDisplayText(object sender, DevExpress.Web.ASPxCardViewSummaryDisplayTextEventArgs e) {
if (e.Item.FieldName == "CategoryID")
e.Text = string.Format("Sum = {0}", Convert.ToDouble(e.Value) * Convert.ToDouble(ASPxSpinEdit1.Value));
}
Protected Sub ASPxCardView1_SummaryDisplayText(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxCardViewSummaryDisplayTextEventArgs)
If e.Item.FieldName = "CategoryID" Then
e.Text = String.Format("Sum = {0}", Convert.ToDouble(e.Value) * Convert.ToDouble(ASPxSpinEdit1.Value))
End If
End Sub
See Also
ASPxCardViewSummaryDisplayTextEventArgs Class