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 Grouping : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridGroupHeaderItem)
        {
            (e.Item as GridGroupHeaderItem).DataCell.Visible
            = false;
            e.Item.PreRender += new EventHandler(Item_PreRender);
        }
    }
    void Item_PreRender(object sender, EventArgs e)
    {
        string text = ((GridGroupHeaderItem)sender).DataCell.Text;
        for (int i = 3;
        i < ((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns.Length; i++)
        {
            TableCell cell = new TableCell();
            if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "UnitPrice")
            {
                cell.HorizontalAlign = HorizontalAlign.Right;
                cell.Text = text;
            }
            ((GridGroupHeaderItem)sender).Cells.Add(cell);
        }
    }

}