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

Grid Grouping Sum and Count Problem

2 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mehmet
Top achievements
Rank 1
Mehmet asked on 29 Jul 2011, 12:01 PM
Hi

Grid dynamically fill data, the dynamic Aggregate add dynamic columns, the problem starts here. No problem when a single group, multiple groups is by attaching the calculations do not understand the results.



<telerik:RadGrid  ShowFooter="True" ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowSorting="True" GridLines="None" ShowGroupPanel="True" Skin="Web20" PageSize="15">
<MasterTableView ShowGroupFooter="True" GroupLoadMode="Client"  CellSpacing="-1"></MasterTableView>
<ClientSettings AllowDragToGroup="True"></ClientSettings>
<ExportSettings OpenInNewWindow="True" ExportOnlyData="True"  FileName="DataExport"></ExportSettings>
</telerik:RadGrid>

Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated
 
           If e.Column.DataType.Name = "DateTime" Then
               CType(e.Column, Telerik.Web.UI.GridBoundColumn).DataFormatString = "{0:dd/MM/yyyy}"
           End If
 
           If e.Column.DataType.Name = "Decimal" Or e.Column.DataType.Name = "Double" Then
               CType(e.Column, Telerik.Web.UI.GridBoundColumn).DataFormatString = "{0:N3}"
               CType(e.Column, Telerik.Web.UI.GridBoundColumn).Aggregate = Telerik.Web.UI.GridAggregateFunction.Sum
           End If
 
           If e.Column.ColumnType = "GridBoundColumn" And counteklendi = False Then
               CType(e.Column, Telerik.Web.UI.GridBoundColumn).Aggregate = Telerik.Web.UI.GridAggregateFunction.Count
               CType(e.Column, Telerik.Web.UI.GridBoundColumn).FooterText = "Total : "
               counteklendi = True
           End If
 
       End Sub


You can see pictures attached.


2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jul 2011, 01:02 PM
Hello Mehmet,

Take a look at the following documentation.Hope this helps.
Programmatic Definition.

Thanks,
Shinu.
0
Mehmet
Top achievements
Rank 1
answered on 29 Jul 2011, 02:32 PM
Thanks Shinu

document is
the information did not help me: (


Pls help.
Tags
Grid
Asked by
Mehmet
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mehmet
Top achievements
Rank 1
Share this question
or