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

Aggregate="Sum" not working in DetailTable (bug in build 1002)

3 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Morten asked on 23 Oct 2014, 11:20 AM
Hi,

I noticed that Aggregate="Sum" is not working for GridNumericColumn in DetailTables
(build 1002).  It gives the error:

Sum is not supported for type "System.Object"

It is working in previous build 724.

Example:
<telerik:RadGrid ClientSettings-AllowDragToGroup="true" ShowGroupPanel="true" ShowFooter="true" runat="server" ID="rg" AutoGenerateColumns="False" GroupPanelPosition="Top">
    <MasterTableView>
    <Columns>
    <telerik:GridBoundColumn HeaderText="id" DataField="id"></telerik:GridBoundColumn>
    <telerik:GridBoundColumn HeaderText="text" DataField="text"></telerik:GridBoundColumn>
    <telerik:GridBoundColumn HeaderText="value" DataField="Value" Aggregate="Sum"></telerik:GridBoundColumn>
    </Columns>
    <DetailTables>
    <telerik:GridTableView>
    <Columns>
    <telerik:GridBoundColumn HeaderText="id" DataField="id"></telerik:GridBoundColumn>
    <telerik:GridBoundColumn HeaderText="text" DataField="text"></telerik:GridBoundColumn>
    <telerik:GridNumericColumn HeaderText="value" DataField="value" Aggregate="Sum"></telerik:GridNumericColumn>
    </Columns>
    </telerik:GridTableView>
    </DetailTables>
    </MasterTableView>
    </telerik:RadGrid>


Code behind:

Protected Sub rg_DetailTableDataBind(sender As Object, e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles rg.DetailTableDataBind
    Dim dt As New DataTable()
    dt.Columns.Add("id", GetType(Integer))
    dt.Columns.Add("text", GetType(String))
    dt.Columns.Add("value", GetType(Double))
 
    Dim r As DataRow
 
    r = dt.NewRow()
    r("id") = "1"
    r("text") = "nr. 1 detail"
    r("value") = 1.5
    dt.Rows.Add(r)
 
    r = dt.NewRow()
    r("id") = "2"
    r("text") = "nr. 2 detail"
    r("value") = 2.5
    dt.Rows.Add(r)
 
    e.DetailTableView.DataSource = dt
    End Sub
 
    Protected Sub rg_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rg.NeedDataSource
    If e.IsFromDetailTable = False Then
 
    Dim dt As New DataTable()
    dt.Columns.Add("id", GetType(Integer))
    dt.Columns.Add("text", GetType(String))
    dt.Columns.Add("value", GetType(Double))
 
    Dim r As DataRow
 
    r = dt.NewRow()
    r("id") = "1"
    r("text") = "nr. 1"
    r("value") = 1.5
    dt.Rows.Add(r)
 
    r = dt.NewRow()
    r("id") = "2"
    r("text") = "nr. 2"
    r("value") = 2.5
    dt.Rows.Add(r)
 
    rg.DataSource = dt
    End If
    End Sub

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 28 Oct 2014, 10:11 AM
Hi Morten,

We are aware of this issue and our dev team already provide a fix for the problem. The fix is available with the latest official Q3 2014 (v.2014.3.1024) release of the controls.
You can update your application to the latest official release and see of it works for you.

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Pawan
Top achievements
Rank 1
answered on 26 Oct 2016, 09:01 AM

Aggregate of RadGrid is not displaying on Mozila and Internet explorer, only working on Chrome

Check below code:

<telerik:GridBoundColumn HeaderText="Duration(in min)" DataField="Sum_Consumption" Visible="true" AllowFiltering="false" HeaderStyle-Width="0%" ItemStyle-Width="0%" FooterStyle-Width="50px" Aggregate="Sum" DataType="System.Double"></telerik:GridBoundColumn>

And applying datatable to this RadGrid

Please help!!

0
Eyup
Telerik team
answered on 31 Oct 2016, 07:41 AM
Hello Pawan,

Remove the following properties from your configuration and make sure that the Sum_Consumption field in your database holds numeric values:
HeaderStyle-Width="0%" ItemStyle-Width="0%"

Regards,
Eyup
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Grid
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Maria Ilieva
Telerik team
Pawan
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or