Hi,
We have an issue with the server page loading on the gridview. When grouping on multiple fields the application crashed with an OverflowException on the IQueryable. Besides the IQueryable we are also using a custom 'PagingBeforeGroupingQueryableCollectionView' (See attachment).
After adding the second grouping, the Queryable expression is as follows:
{value(IdeaBlade.EntityModel.EntityQueryProxy`1[TableX]).Where(t => ((Convert(t.ObjectTypeID) == Convert(Convert(value(ScreenX).SelectedObjectType.ObjectTypeID))) AndAlso value(ScreenX+<>c__DisplayClass6).moduleIDs.Contains(t.ModuleID))).Where(x => (((x.DescEN.StartsWith("[") OrElse x.DescFR.StartsWith("[")) OrElse x.DescGE.StartsWith("[")) OrElse x.DescNL.StartsWith("["))).OrderBy(x => x.CreationDate).Take(100).GroupBy(item => item.ObjectName).OrderBy(group => group.Key).Select(group => new AggregateFunctionsGroup() {Key = group.Key, ItemCount = group.Count(), HasSubgroups = True, Items = value(IdeaBlade.EntityModel.EntityQueryProxy`1[TableX]).Where(t => ((Convert(t.ObjectTypeID) == Convert(Convert(value(ScreenX).SelectedObjectType.ObjectTypeID))) AndAlso value(ScreenX+<>c__DisplayClass6).moduleIDs.Contains(t.ModuleID))).Where(x => (((x.DescEN.StartsWith("[") OrElse x.DescFR.StartsWith("[")) OrElse x.DescGE.StartsWith("[")) OrElse x.DescNL.StartsWith("["))).OrderBy(x => x.CreationDate).Take(100).Where(item => (item.ObjectName == group.Key)).GroupBy(item => item.ObjectField).OrderBy(group => group.Key).Select(group => new AggregateFunctionsGroup() {Key = group.Key, ItemCount = group.Count(), HasSubgroups = False, Items = group})})}
Statement results in "An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll"
I attached some Images with some more information.
5 Answers, 1 is accepted
I am afraid that with the provided information I cannot confirm the exact cause for this error. May I kindly ask you to clarify whether this StackOverflowException depends on the number of properties defined? Also, since you are using a custom QueryableCollectionView, would it be possible for you to try reproducing the exception with the default implementation of the QCV? Are you experiencing the same issue with it?
Thank you in advance for your cooperation.
Regards,
Stefan X1
Telerik by Progress
Hi
Tried to reproduce the problem with a IQuerable, without any QCV.
We are getting the same result when grouping on 2 columns.
"System.StackOverflowException was unhandled
Message: An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll"
Code snippet:
var query =(IEntityQuery<TblLstTranslation>)_dataService.GetManager().TblLstTranslation.Where(t => t.ObjectTypeID =(short)SelectedObjectType.ObjectTypeID && moduleIDs.Contains(t.ModuleID)); if (!IsTranslated){ query = query.Where(x => x.DescEN.StartsWith("[") || x.DescFR.StartsWith("[") || x.DescGE.StartsWith("[") || x.DescNL.StartsWith("["));} Translations = query.OrderBy(x => x.CreationDate).AsQueryable<TblLstTranslation>();
Kind Regards
Thanks for the clarification and the snippet provided.
Unfortunately, I still cannot confirm whether this exception is due to some server side logic or not. As already asked in my previous reply, can you please test the application on your end whether the count of the properties matters in reproducing the issue?
Regards,
Stefan X1
Telerik by Progress
Hi Stefan,
"can you please test the application on your end whether the count of the properties matters in reproducing the issue"
I tried with 2 properties (see grid), and I'm getting the same behavior. I attached some information about the current setup I'm testing with. We are using an IQueryable property which we attach to the Itemssource of the grid. (See screenshot 1 - 2 - 3)
Grouping on one property at the same time is working fine. But drag and drop the second (Objectfield) results into 'Process is terminated due to StackOverflowException'. I'm pasting the query IQueryable is generating on the bottom as those are very big and not possible to attach a TXT file..
Note; I'm not able to run / test the telerik demo - Server page, sort, Group and filter correctly. I'm getting the error 'The underlying provider failed on Open' (see attached picture 'TelerikDemo.png')
First grouping
87 : 24/04/2017 13:09:49 : Guest - 2 : IdeaBlade.EntityModel.Server.EntityServerQueryInterceptor:ExecuteQuery : Fetch ... value(IdeaBlade.EntityModel.EntityQueryProxy`1[CSD4.Data.ModuleModel.TblLstTranslation]).Where(t => ((Convert(t.ObjectTypeID) == 2) AndAlso value(System.Collections.Generic.List`1[System.Byte]).Contains(t.ModuleID))).Where(x => (((x.DescEN.StartsWith("[") OrElse x.DescFR.StartsWith("[")) OrElse x.DescGE.StartsWith("[")) OrElse x.DescNL.StartsWith("["))).OrderBy(x => x.CreationDate).GroupBy(item => item.ObjectName).OrderBy(group => group.Key).Select(group => new AggregateFunctionsGroup() {Key = group.Key, ItemCount = group.Count(), HasSubgroups = False, Items = group})
Second grouping
89 : 24/04/2017 13:10:33 : Guest - 2 : IdeaBlade.EntityModel.Server.EntityServerQueryInterceptor:ExecuteQuery : Fetch ... value(IdeaBlade.EntityModel.EntityQueryProxy`1[CSD4.Data.ModuleModel.TblLstTranslation]).Where(t => ((Convert(t.ObjectTypeID) == 2) AndAlso value(System.Collections.Generic.List`1[System.Byte]).Contains(t.ModuleID))).Where(x => (((x.DescEN.StartsWith("[") OrElse x.DescFR.StartsWith("[")) OrElse x.DescGE.StartsWith("[")) OrElse x.DescNL.StartsWith("["))).OrderBy(x => x.CreationDate).GroupBy(item => item.ObjectName).OrderBy(group => group.Key).Select(group => new AggregateFunctionsGroup() {Key = group.Key, ItemCount = group.Count(), HasSubgroups = True, Items = value(IdeaBlade.EntityModel.EntityQueryProxy`1[CSD4.Data.ModuleModel.TblLstTranslation]).Where(t => ((Convert(t.ObjectTypeID) == 2) AndAlso value(System.Collections.Generic.List`1[System.Byte]).Contains(t.ModuleID))).Where(x => (((x.DescEN.StartsWith("[") OrElse x.DescFR.StartsWith("[")) OrElse x.DescGE.StartsWith("[")) OrElse x.DescNL.StartsWith("["))).OrderBy(x => x.CreationDate).Where(item => (item.ObjectName == group.Key)).GroupBy(item => item.ObjectField).OrderBy(group => group.Key).Select(group => new AggregateFunctionsGroup() {Key = group.Key, ItemCount = group.Count(), HasSubgroups = False, Items = group})})
Thanks for the support.
Thanks for your cooperation.
Unfortunately, I cannot relate this behavior to any known issue of RadGridView. Can you please share some details on the database engine that you are using, so I can investigate whether any known problems have been previously reported? May I also kindly ask you to try a similar approach but without the usage of RadGridView? Is the issue still reproducible?
Best Regards,
Stefan X1
Telerik by Progress