Tab

ASPxVerticalGrid.GetTotalSummaryValue(ASPxVerticalGridSummaryItem) Method

Returns a summary value calculated against all records.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

public object GetTotalSummaryValue(
    ASPxVerticalGridSummaryItem item
)
Public Function GetTotalSummaryValue(
    item As ASPxVerticalGridSummaryItem
) As Object

Parameters

Name Type Description
item ASPxVerticalGridSummaryItem

An ASPxVerticalGridSummaryItem object that represents the summary item.

Returns

Type Description
Object

An object which represents the summary value.

Remarks

The ASPxVerticalGrid enables you to calculate a total summary that calculates an aggregate function by all records and displays the result in the summary panel. A total summary type is represented by a ASPxVerticalGridSummaryItem object.

Examples

View Example

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <dx:ASPxVerticalGrid ID="ASPxVerticalGrid1" runat="server" OnCustomSummaryCalculate="ASPxVerticalGrid1_CustomSummaryCalculate" Width="700px" AutoGenerateRows="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID">
            <Rows>
                <dx:VerticalGridTextRow FieldName="ProductID" VisibleIndex="0">
                </dx:VerticalGridTextRow>
                <dx:VerticalGridTextRow FieldName="ProductName" VisibleIndex="1">
                </dx:VerticalGridTextRow>
                <dx:VerticalGridTextRow FieldName="UnitPrice" VisibleIndex="2">
                </dx:VerticalGridTextRow>
                <dx:VerticalGridTextRow FieldName="UnitsInStock" VisibleIndex="3">
                </dx:VerticalGridTextRow>
                <dx:VerticalGridTextRow FieldName="UnitsOnOrder" VisibleIndex="4">
                </dx:VerticalGridTextRow>
            </Rows>
            <TotalSummary>                
                <dx:ASPxVerticalGridSummaryItem SummaryType="Average" FieldName="UnitPrice" />
                <dx:ASPxVerticalGridSummaryItem SummaryType="Average" FieldName="UnitsOnOrder" />
                <dx:ASPxVerticalGridSummaryItem SummaryType="Custom" DisplayFormat="Average Sum ={0}" />
            </TotalSummary>
            <Settings ShowSummaryPanel="True" />
            <SettingsPager Mode="ShowPager"></SettingsPager>
        </dx:ASPxVerticalGrid>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\nwind.mdb;Persist Security Info=True" ProviderName="System.Data.OleDb" SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice], [UnitsInStock], [UnitsOnOrder] FROM [Products]"></asp:SqlDataSource>

    </div>
    </form>
</body>
</html>