Essential Studio for Asp.Net | Demos

SHOWCASE SAMPLES
Showcase samples
    Grid / Summary / Basic
    <%@ Page Title="Grid-Basic-ASP.NET-SYNCFUSION"   Language="C#" MetaDescription="This demo explains how to display the summary values such as average, minimum, etc., for the columns in Syncfusion ASP.NET Web Forms DataGrid." AutoEventWireup="true" CodeBehind="Summary.aspx.cs" MasterPageFile="~/Samplebrowser.Master" Inherits="WebSampleBrowser.Grid.Summary" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="SampleHeading" runat="server">
        <span class="sampleName">Grid / Summary / Basic</span>
    </asp:Content>
    
    <asp:Content ID="ControlContent" runat="server" ContentPlaceHolderID="ControlsSection">
        <div>
            <ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" ShowSummary="True">
                <PageSettings PageSize="10"></PageSettings>
                <SummaryRows>
                    <ej:SummaryRow Title="Sum">
                        <SummaryColumn>
                            <ej:SummaryColumn SummaryType="Sum" Format="{0:C}" DisplayColumn="Freight" DataMember="Freight" />
                        </SummaryColumn>
                    </ej:SummaryRow>
                    <ej:SummaryRow Title="Average">
                        <SummaryColumn>
                            <ej:SummaryColumn SummaryType="Average" Format="{0:C}" DisplayColumn="Freight" DataMember="Freight" />
                        </SummaryColumn>
                    </ej:SummaryRow>
                    <ej:SummaryRow Title="Smallest">
                        <SummaryColumn>
                            <ej:SummaryColumn SummaryType="Minimum" Format="{0:C}" DisplayColumn="Freight" DataMember="Freight" />
                        </SummaryColumn>
                    </ej:SummaryRow>
                    <ej:SummaryRow Title="Largest">
                        <SummaryColumn>
                            <ej:SummaryColumn SummaryType="Maximum" Format="{0:C}" DisplayColumn="Freight" DataMember="Freight" />
                        </SummaryColumn>
                    </ej:SummaryRow>
                </SummaryRows>
                <Columns>
                    <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" TextAlign="Right" Width="80" />
                    <ej:Column Field="EmployeeID" HeaderText="Employee ID" TextAlign="Right" Width="80" />
                    <ej:Column Field="ShipCity" HeaderText="Ship City" Width="90" />
                    <ej:Column Field="ShipName" HeaderText="Ship Name" Width="110" />
                    <ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="100" />
                    <ej:Column Field="Freight" HeaderText="Freight" TextAlign="Right" Width="80" Format="{0:C}" />
                </Columns>
            </ej:Grid>
        </div>
    </asp:Content>
    
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebSampleBrowser.Grid
    {
        public partial class Summary : System.Web.UI.Page
        {
            private List<Orders> order = new List<Orders>();
            protected void Page_Load(object sender, EventArgs e)
            {
                BindDataSource();
            }
    
            private void BindDataSource()
            {
                int code = 10000;
                for (int i = 1; i < 10; i++)
                {
                    order.Add(new Orders(code + 1, i + 0, "Berlin", "Alfreds Futterkiste", "Germany", 2.3*i));
                    order.Add(new Orders(code + 2, i + 2, "Madrid", "Bólido Comidas preparadas", "Spain", 3.3*i));
                    order.Add(new Orders(code + 3, i + 1, "Cholchester", "Around the Horn", "UK", 4.3*i));
                    order.Add(new Orders(code + 4, i + 3, "Marseille", "Bon app'", "France", 5.3*i));
                    order.Add(new Orders(code + 5, i + 4, "London", "B's Beverages", "UK", 6.3*i));
                    code += 5;
                }
                this.OrdersGrid.DataSource = order;
                this.OrdersGrid.DataBind();
            }
    
            [Serializable]
            public class Orders
            {
                public Orders()
                {
    
                }
                public Orders(long OrderId, int EmployeeId, string ShipCity, string ShipName, string ShipCountry,
                    double Freight)
                {
                    this.OrderID = OrderId;
                    this.EmployeeID = EmployeeId;
                    this.ShipCity = ShipCity;
                    this.ShipName = ShipName;
                    this.ShipCountry = ShipCountry;
                    this.Freight = Freight;
                }
                public long OrderID { get; set; }
                public int EmployeeID { get; set; }
                public string ShipCity { get; set; }
                public string ShipName { get; set; }
                public string ShipCountry { get; set; }
                public double Freight { get; set; }
            }
        }
    }