using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Telerik.Web.UI;


public partial class _Default : System.Web.UI.Page
{
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        GridGroupByExpression expression = new GridGroupByExpression();
        GridGroupByField gridGroupByField = new GridGroupByField();
        // SelectFields values (appear in header)
        gridGroupByField = new GridGroupByField();
        gridGroupByField.FieldName = "EmployeeID";
        gridGroupByField.HeaderText = "Employee";
        gridGroupByField.HeaderValueSeparator = " for current group: ";
        gridGroupByField.FormatString = "<strong>{0}</strong>";
        expression.SelectFields.Add(gridGroupByField);
        gridGroupByField = new GridGroupByField();
        gridGroupByField.FieldName = "Freight";
        gridGroupByField.HeaderText = "Total shipping cost is ";
        gridGroupByField.HeaderValueSeparator = "";
        gridGroupByField.FormatString = "<strong>{0:0.00}</strong>";
        gridGroupByField.Aggregate = GridAggregateFunction.Sum;
        expression.SelectFields.Add(gridGroupByField);
        //GroupByFields values    (group data)
        gridGroupByField = new GridGroupByField();
        gridGroupByField.FieldName = "EmployeeID";
        expression.GroupByFields.Add(gridGroupByField);
        RadGrid1.MasterTableView.GroupByExpressions.Add(expression);
    }
}

public class Customer
{
    public string CustomerID { get; set; }
    public string CompanyName { get; set; }
    public string ContactName { get; set; }
    public string ContactTitle { get; set; }
    public string Address { get; set; }
    public string PostalCode { get; set; }
}




 

