This is a migrated thread and some comments may be shown as answers.

Help

3 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
w l
Top achievements
Rank 1
w l asked on 05 Jul 2010, 10:06 AM
TELIRIK GRID Aggregate count method of how the statistics of non-null value

3 Answers, 1 is accepted

Sort by
0
Bruno
Top achievements
Rank 2
answered on 05 Jul 2010, 10:56 AM
this is Burno
am developing with Telerik controls
can you understand your explaination a bit? am worried about the means

here is my source
http://www.telerik.com/help/aspnet-ajax/grdcolumnaggregates.html
0
w l
Top achievements
Rank 1
answered on 05 Jul 2010, 11:12 AM
A B C D
1 4 6 7
2   6 7
3 4   7
3 2 2 3

0
Princy
Top achievements
Rank 2
answered on 05 Jul 2010, 11:44 AM
Hello,

 You can set the Aggregate property of GridBoundColumn to "Custom" and in  OnCustomAggregate event calculate the aggregate set the result. Check out the following code snippet which illustrates same.

ASPX:
  
  <telerik:GridBoundColumn DataField="LastName" HeaderText="LastName" UniqueName="LastName" Aggregate="Custom" /> 

C#:
 
 protected void RadGrid1_CustomAggregate(object sender, GridCustomAggregateEventArgs e) 
    { 
       if (((Telerik.Web.UI.GridBoundColumn)e.Column).UniqueName == "LastName"
        { 
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
            { 
                if (item["LastName"].Text != "&nbsp;")    
                    count++; 
            } 
            e.Result = count; 
        } 
    } 

Thanks,
Princy.


Tags
Grid
Asked by
w l
Top achievements
Rank 1
Answers by
Bruno
Top achievements
Rank 2
w l
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or