using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;   

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {        
    }
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        
    }
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        foreach (var expression in RadGrid1.MasterTableView.GroupByExpressions)
        {
            if (!(expression.Expression.ToLower().Contains("count")))
            {                
          //      string str = "Count(" +expression.GroupByFields[0].ToString().Remove(expression.GroupByFields[0].ToString().Length-1)  + ") ";
          //      expression.GroupByFields[0].FieldAlias = expression.GroupByFields[0].ToString().Remove(expression.GroupByFields[0].ToString().Length - 1) + "1";
          //      string tmp = expression.Expression;
          //      expression.Expression = str + expression.GroupByFields[0].FieldAlias + " " + tmp;
            }
        }
    }
}