[DevExpress Support Team: CLONED FROM T319091: OutOfMemoryException is thrown in prefilter if a field provides many unique values]
Hello,
In the empty grid, opening a prefilter is causing the error.
Working draft has been updated through the Upgrade Project.
No changes have been made more.
Error:
Value cannot be null.
Parameter name: source
StackTrace:
at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
at DevExpress.PivotGrid.ServerMode.MultipleLevelsQueryExecutor.QueryValuesCore(ISelectCriteriaConvertible column, SortCriteria sort, List`1 filter, Int32 topCount, Boolean isTopPercentage)
at DevExpress.PivotGrid.ServerMode.MultipleLevelsQueryExecutor.DevExpress.PivotGrid.ServerMode.IServerModeQueryExecutor.QueryValues(IServerModeHelpersOwner owner, QueryColumn column, Dictionary`2 values)
at DevExpress.PivotGrid.ServerMode.ServerModeDataSource.DevExpress.PivotGrid.ServerMode.IServerModeHelpersOwner.QueryValues(QueryColumn column, Dictionary`2 values)
at DevExpress.PivotGrid.QueryMode.UniqueValues`1.GetUniqueValues(AreasType column)
at DevExpress.PivotGrid.QueryMode.UniqueValues`1.GetUniqueValues(PivotGridFieldBase field)
at DevExpress.Web.ASPxPivotGrid.PivotGridField.DevExpress.Web.FilterControl.IFilterColumn.get_PropertiesEdit()
at DevExpress.Web.FilterControl.FilterControlColumnBuilder.CreateFilterControlColumn(IFilterColumn externalColumn)
at DevExpress.Web.FilterControl.FilterControlColumnBuilder.CreateMissingExternalColumns()
at DevExpress.Web.FilterControl.FilterControlColumnBuilder.GenerateColumns(Object sourceType, Boolean allowHierarchicalColumns, Int32 maxHierarchyDepth, Boolean showAllDataSourceColumns, IEnumerable`1 externalColumns)
at DevExpress.Web.ASPxPivotGrid.ASPxPivotGrid.GenerateFilterColumns()
at DevExpress.Web.ASPxPivotGrid.ASPxPivotGrid.DevExpress.Web.FilterControl.IFilterControlOwner.GetFilterColumns()
at DevExpress.Web.FilterControl.WebFilterCriteriaDisplayTextGenerator.GetFilterColumnName(String propertyName)
at DevExpress.Web.ASPxPivotGrid.Internal.PivotWebFilterCriteriaDisplayTextGenerator.GetFilterColumnName(String propertyName)
at DevExpress.Web.FilterControl.WebFilterCriteriaDisplayTextGenerator.DevExpress.Data.Filtering.Helpers.IDisplayCriteriaGeneratorNamesSource.GetDisplayPropertyName(OperandProperty property)
at DevExpress.Data.Filtering.Helpers.DisplayCriteriaGenerator.Convert(OperandProperty theOperand)
at DevExpress.Data.Filtering.Helpers.DisplayCriteriaGenerator.Visit(BinaryOperator theOperator)
at DevExpress.Web.FilterControl.WebFilterCriteriaDisplayTextGenerator…ctor(IFilterControlOwner filterOwner, CriteriaOperator criteria, Boolean encodeValue)
at DevExpress.Web.ASPxPivotGrid.Internal.PivotWebFilterControlPopupRow.CreateFilterCriteriaDisplayTextGenerator(IFilterControlOwner filterOwner, Boolean encodeValue)
at DevExpress.Web.FilterControl.WebFilterControlPopupRow.GetFilterCriteriaText(IFilterControlOwner filterOwner, Boolean encodeValue)
at DevExpress.Web.FilterControl.WebFilterControlPopupRow.CreateControlHierarchy()
at DevExpress.Web.Internal.InternalTable.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.Internal.RenderUtils.EnsureChildControlsRecursive(Control control, Predicate`1 skipControlCondition)
at DevExpress.Web.ASPxPivotGrid.ASPxPivotGrid.EnsureChildControlsRecursive(Control control, Boolean skipContentContainers)
at DevExpress.Web.ASPxWebControlBase.EnsureChildControlsRecursive(Control control)
at DevExpress.Web.ASPxWebControlBase.CreateChildControls()
at DevExpress.Web.ASPxWebControl.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at DevExpress.Web.ASPxPivotGrid.ASPxPivotGrid.GetCallbackResult()
at DevExpress.Web.ASPxWebControl.System.Web.UI.ICallbackEventHandler.GetCallbackResult()
Server Mode - An exception is raised on opening the prefilter if the Unbound Field with Aggregated data is shown in the filter area
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
- v16.1.4Download Official Update
- v15.2.5Download Official Update
I have tried to replicate the problem on my side but have not noticed any issue (I am using hot fix version 15.2.4.16013). You can find my test project in the attachment. Please check how it function on your side. If it function correctly, change it to replicate the problem or provide us with your sample project replicating the issue. We will review it and do our best to find a solution for you.
I am awaiting your response.
Hi Constantin.
This problem occurs when you open the application and use of MVC Prefilter Server Mode (in the previous task is specified), and not a Windows application.
I think these errors relate. https://www.devexpress.com/Support/Center/Question/Details/T335332
Please accept my apologies for providing you with an incorrect example before. I have attached my test MVC project to this reply. I am using the following code to bind a pivot grid to an empty data source:
.BindToEF(typeof(MPG_ServerMode.Models.ContosoRetailDWEntities), "V_CustomerOrders", (s, e) => { e.QueryableSource = new MPG_ServerMode.Models.ContosoRetailDWEntities().V_CustomerOrders.Take(0); }).GetHtml()
The Prefilter control functions correctly in this example. Would you please clarify how to replicate the problem?
BTW: We are currently working on the T335332: Sequence contains no matching element request, but I doubt that these problems are connected.
Hello
I see the attached example you.
Used me sources are empty, and the data is successfully displayed in the table, but using a template prefilter error.
I have this same situation you have a demo example. https://demos.devexpress.com/MVCxPivotGridDemos/Features/DataBindingToLargeDatabase
If I cut out all of the fields from the PivotGrid for which https://www.devexpress.com/Support/Center/Question/Details/T335332 fails the current there is no error.
If you cannot identify the problem, I will try to assemble the demo example.
I was unable to replicate the problem with MVCxPIvotGrid demo. It will require more time to test this functionality with data sources provided in the T335332: Sequence contains no matching element thread. I will notify you of our results.
I have managed to reproduce the described problem on my side with the provided MS SQL database. It will require some time to research it in greater detail. I have passed this issue to our developers for further research. We will update the thread once we have any results.
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
Additional information: Sequence contains no matching element