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

GridCalculatedColumn Aggrigate does not work

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
lyners
Top achievements
Rank 1
lyners asked on 03 Jul 2012, 05:05 PM
Hello all,
Using RadGrid version 2011.3.1305.40 I have a gridcalculatedfield that works until I want a total at the footer.

This is my field:
<telerik:GridCalculatedColumn 
                            DataFields="oneAmt,twoAmt,threeAmt" 
                            Expression="{0}-{1}-{2}"
                            UniqueName="netAmt" 
                            AllowFiltering="False" 
                            AllowSorting="False"
                            DataFormatString="{0:c}" 
                            Groupable="False"
                            HeaderText="Net Amount" 
                            Reorderable="False" 
                            ShowSortIcon="False" Aggregate="Sum" DataType="System.Decimal" 
                            FooterAggregateFormatString="{0:c}">
                            <FooterStyle HorizontalAlign="Right" />
                            <HeaderStyle HorizontalAlign="Right" />
                            <ItemStyle HorizontalAlign="Right" />
</telerik:GridCalculatedColumn>

The error I get when I run this is:
Inner Exception Type: System.Reflection.TargetInvocationException
Inner Exception: Exception has been thrown by the target of an invocation.
Inner Source: mscorlib
Inner Stack Trace:    at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Telerik.Web.UI.GridBoundColumn.GetAggregate(IEnumerable enumerable, IQueryable queryable, String fieldName, Type dataType, GridAggregateFunction func)
   at Telerik.Web.UI.GridCalculatedColumn.ApplyAggregates35(TableCell cell, String footerText)
   at Telerik.Web.UI.GridCalculatedColumn.footerCell_DataBinding(Object sender, EventArgs e)
   at System.Web.UI.Control.OnDataBinding(EventArgs e)
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
   at Telerik.Web.UI.GridItemBuilder.CreateGroupFooterItem(GridGroupingContext group)
   at Telerik.Web.UI.GridItemBuilder.HandleGrouping(GridGroupingContext group, GridEnumerableBase enumerable, Boolean& isGroup, Boolean& isGroupFooter)
   at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
   at Telerik.Web.UI.GridItemBuilder.CreateGroupSubItems(GridGroupingContext group, GridEnumerableBase enumerable)
   at Telerik.Web.UI.GridItemBuilder.HandleGrouping(GridGroupingContext group, GridEnumerableBase enumerable, Boolean& isGroup, Boolean& isGroupFooter)
   at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
   at Telerik.Web.UI.GridItemBuilder.CreateGroupSubItems(GridGroupingContext group, GridEnumerableBase enumerable)
   at Telerik.Web.UI.GridItemBuilder.HandleGrouping(GridGroupingContext group, GridEnumerableBase enumerable, Boolean& isGroup, Boolean& isGroupFooter)
   at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
   at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls)
   at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
   at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
   at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
   at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   at Telerik.Web.UI.GridTableView.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at Telerik.Web.UI.GridTableView.DataBind()
   at Telerik.Web.UI.RadGrid.DataBind()
   at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
   at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
   at System.Web.UI.Control.EnsureChildControls()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Exception Type: System.Web.HttpUnhandledException
Exception: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: DefaultPage
Stack Trace: 
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.fiscalanalysis_fiscalreportanalysisdisplay_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ef32ca4f\11f861fb\App_Web_3whl54po.2.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Your help is appreciated.

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 06 Jul 2012, 07:40 AM
Hi Lyners,

I tried to reproduce the described issue with the latest version (2012.2.607.40) of our controls, but to no avail. I am sending you a simple example based on your code snippet. Could you please try upgrading to the latest version of the controls and let me know if the issue still persists.

Looking forward for your reply.

Kind regards,
Radoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
lyners
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or