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:
Code behind:
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