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

4 posts, 0 answers
  1. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 23 Oct 2014 Link to this post

    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

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 28 Oct 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pawan
    Pawan avatar
    7 posts
    Member since:
    Jul 2016

    Posted 26 Oct Link to this post

    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!!

  5. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 31 Oct Link to this post

    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.
Back to Top