ASPxGridSummaryDisplayTextEventArgs.Text Property
In This Article
Gets or sets the display text for the summary value currently being processed.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
#Property Value
Type | Description |
---|---|
String | A String value that specifies the summary value’s display text. |
#Remarks
Initially, the Text property contains the text currently displayed in the summary. To provide custom text, assign it to the Text property.
Use the ASPxGridSummaryDisplayTextEventArgs.Value property to get the processed summary value.
#Example
The following example illustrates how to use the Text property.
Web Forms approach:
protected void ASPxGridView1_SummaryDisplayText(object sender, ASPxGridViewSummaryDisplayTextEventArgs e) {
if(e.Item.FieldName == "CategoryID")
e.Text = string.Format("Sum = {0}", Convert.ToDouble(e.Value) * Convert.ToDouble(ASPxSpinEdit1.Value));
}
MVC approach:
Html.DevExpress().GridView(settings => {
settings.Name = "dxGridView";
...
settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, "ShipName");
settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "UnitPrice").DisplayFormat = "c";
settings.SummaryDisplayText = (sender, e) => {
if(e.Item.FieldName == "UnitPrice")
e.Text = string.Format("Sum of unit price: ${0}", Convert.ToDouble(e.Value));
if(e.Item.FieldName == "ShipName")
e.Text = string.Format("Count of records: {0}", Convert.ToDouble(e.Value));
};
})
.Bind(Model)
.Render();
See Also