CalculateAggregates throws InvalidCastException

3 posts, 0 answers
  1. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 29 Jan 2010 Link to this post

    Hi,

    On my grid, I'm using load date from Analysis Server and call CalculateAggregates to display sum. This works fine but when I specified myself the DataType of the column, I get the following error:

    InvalidCastException: The specified cast is not valid.

    With the following stacktrace:
       à lambda_method(ExecutionScope , DataRowContainer )
       à System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
       à System.Linq.Enumerable.Sum(IEnumerable`1 source)
       à lambda_method(ExecutionScope , IGrouping`2 )
       à System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
       à Telerik.Windows.Data.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions)
       à Telerik.Windows.Controls.GridView.GridViewDataControl.CreateAggregateResults()
       à Telerik.Windows.Controls.GridView.GridViewDataControl.CalculateAggregates()
       à Total.Book.IHM.SL.GridActions.SLGrid2.SetFooter()

    How can I fix that ?

    For information, here is my DataRowContainerClass which don't work:

    [

    DataContract]

     

     

    public class DataRowContainer

     

    {

    [

    DataMember]

     

     

    public List<RowID> RowID { get; set; }

     

    [

    DataMember]

     

     

    public object[] RawData { get; set; }

     

    }

    The RawData property contains the content of the row and I'm sure, after checking, that the Double column have only doubles values.


    Any ideas ?


    Thanks !

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 03 Feb 2010 Link to this post

    Hello,

    You will get such exception when the data type does not match the specified type.

    Sincerely yours,
    Vlad
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. DevCraft banner
  4. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 03 Feb 2010 Link to this post

    Hi Vlad,

    Yes, I know this but it looks like the data type mathes correctly. I've send a support ticket: i'll give another try and will let you know the state.


    Thanks !
Back to Top