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

Aggregate don't work anymore (Q2 2010->.NET4)

4 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hans van Rijnswoud
Top achievements
Rank 2
Hans van Rijnswoud asked on 28 Oct 2010, 01:08 PM
Hi,

We migrate all application to .NET4 C# and Telerik Q2 2010.
In a overview we use in the grid Aggregate="Sum"
With the old version of telerik Q3 2009 work this perfect.
Now with the new version I have the followin error:

MESSAGE:
Exception has been thrown by the target of an invocation.
  
STACKTRACE:
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 Telerik.Web.UI.GridBoundColumn.GetAggregate(IEnumerable enumerable, IQueryable queryable, String fieldName, Type dataType, GridAggregateFunction func)
at Telerik.Web.UI.GridBoundColumn.ApplyAggregates35(TableCell cell, String footerText)
at Telerik.Web.UI.GridBoundColumn.cell_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.GridTableView.CreateFooterItem(Boolean useDataSource, GridColumn[] copiedColumnSet, GridTFoot tfoot)
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 Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason)
at Telerik.Web.UI.RadGrid.Rebind()
at Adver.Vis.Pages.Reports.BackofficePublish.BtnFilter_OnClick(Object sender, EventArgs e) in C:\_vsp\XXXX.aspx.cs:line 48
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Code of grid:
<telerik:RadGrid ID="RadGrid1" 
           AllowSorting="True"
           AllowPaging="false" 
           runat="server" 
           GridLines="None"
           Width="100%" 
           OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated"
           OnExcelMLExportRowCreated="RadGrid1_ExcelMLExportRowCreated"
           OnItemCommand="RadGrid1_ItemCommand" 
           OnItemDataBound="RadGrid_OnItemDataBound" 
           AutoGenerateColumns="false" OnNeedDataSource="RadGrid_OnNeedDataSource" ShowFooter="true">
           <ClientSettings EnableRowHoverStyle="true" />
           <MasterTableView Width="100%" CommandItemDisplay="Top" OverrideDataSourceControlSorting="true" UseAllDataFields="true">
               <PagerStyle Mode="NextPrevNumericAndAdvanced" />
               <CommandItemSettings 
                   ShowExportToWordButton="true"
                   ShowExportToExcelButton="true" 
                   ShowExportToCsvButton="true"
                   ShowExportToPdfButton="true" AddNewRecordImageUrl="../../Img/spacer.gif" AddNewRecordText=""/>
               <Columns>
                   <telerik:GridTemplateColumn HeaderText="Medewerkers">
                       <ItemTemplate>
                           <asp:Label ID="lbl_FirstName" runat="server"><%# Eval("User.FirstName")%></asp:Label
                           <asp:Label ID="lbl_Lastname" runat="server"><%# Eval("User.LastName")%></asp:Label>
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridBoundColumn UniqueName="ClPublishVac" HeaderText="Text" DataField="TotalPublish" Aggregate="Sum" FooterAggregateFormatString="Totaal :{0}">
                       </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="ClUpdateVac" HeaderText="Text" DataField="TotalUpdate" Aggregate="Sum" FooterAggregateFormatString="Totaal :{0}">
                       </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="CLRefreshVac" HeaderText="Text" DataField="TotalRefresh" Aggregate="Sum" FooterAggregateFormatString="Totaal :{0}">
                       </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="ClDeleteVac" HeaderText="Text" DataField="TotalDelete" Aggregate="Sum" FooterAggregateFormatString="Totaal :{0}">
                       </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="ClTotal" HeaderText="Totaal" DataField="Total" Aggregate="Sum" FooterAggregateFormatString="Totaal :{0}">
                       </telerik:GridBoundColumn>
               </Columns>
           </MasterTableView>
       </telerik:RadGrid>



Without the "Aggregate" work the gris perfect.
Any idee about this problem.

In advance thanks for your answer.

Regards,

Edwin.

4 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 01 Nov 2010, 12:47 PM
Hello Edwin,

I tried to reproduce the described issue, but to no avail. I am sending you a simple example, please check it out and let me know what differs in your case.
Looking forward for your reply.

All the best,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Adam
Top achievements
Rank 1
answered on 27 Jul 2011, 07:27 PM
I'm experiencing this issue as well. I've got it working on another page, but with this new page, it didn't work.

I've been binding a datatable to the Grid through the NeedDataSource function. After specifying the data type for the column in the datatable, it works just fine. When the grid has to make assumptions as to the datatype, it doesn't appear to work. Also setting the datatype on the grid column doesn't resolve the issue, only when I set the data type of the column in the datatable.
0
Daniel
Telerik team
answered on 02 Aug 2011, 11:06 AM
Hello Adam,

Could you please help us to reproduce the problem on our end?  We would appreciate it, if you could submit a regular support ticket with runnable sample project attached.
Isolating a problem in a sample project

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Adam
Top achievements
Rank 1
answered on 15 Aug 2011, 05:16 PM
I had resolved the issue by setting the data type of the column in the datatable before binding.
Tags
Grid
Asked by
Hans van Rijnswoud
Top achievements
Rank 2
Answers by
Radoslav
Telerik team
Adam
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or