ASPxCardViewSummaryDisplayTextEventArgs.Item Property
Gets a summary item whose value is being processed.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v19.2.dll
Declaration
Property Value
Type | Description |
---|---|
ASPxCardViewSummaryItem | An ASPxCardViewSummaryItem object that represents the summary item whose value is being processed. |
Example
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.
Note
A complete sample project is available in the following repository: https://github.com/DevExpress-Examples/aspxcardview-how-to-implement-a-summary-whose-value-depends-upon-an-external-editor-value-t333558.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
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));
}
}