aspnetmvc-devexpress-dot-web-dot-mvc-dot-gridviewsettings-ebdb82d8.md
Enables custom display text to be provided for any summary value.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public ASPxGridViewSummaryDisplayTextEventHandler SummaryDisplayText { get; set; }
Public Property SummaryDisplayText As ASPxGridViewSummaryDisplayTextEventHandler
| Type | Description |
|---|---|
| ASPxGridViewSummaryDisplayTextEventHandler |
An ASPxGridViewSummaryDisplayTextEventHandler delegate method allowing you to implement custom processing.
|
This sample demonstrates how to use the GridViewSettings.SummaryDisplayText delegate method to define custom texts for group and total summaries displayed within the GridView.
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