We are currently on Infragistics version 13.2 of win forms.
Our current implementation of the UltraWinGrid uses a combination of the following features:
- Row Filters
- Group by a single column
- An unbound column with data derived from a formula
- A custom summary on that unbound column that is itself derived from a formula Sum([a] - Sum([b]) / 100
FormulaRowIndexSource is not set (so it defaults to VisibleIndex)
On Application start, a data table is bound to the grid and all of the above happens except for the row filter value. Summary values are correct. However, when the user sets a filter value on the unbound column (i.e. <= 15000) upon filter evaluation the grid throws the following exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Infragistics.Shared.SparseArray.ValidateIndex(Int32 index)
at Infragistics.Shared.SparseArray.GetItem(Int32 index, ICreateItemCallback createItemCallback)
at Infragistics.Shared.SparseArray.GetItem(Int32 index)
at Infragistics.Win.CalcEngine.UCRecalcChain.HSparseArray.get_Item(Int32 index)
at Infragistics.Win.CalcEngine.UCRecalcChain.get_Item(Int32 index)
at Infragistics.Win.CalcEngine.UCRecalcChain.RemoveDisposedReferences()
at Infragistics.Win.CalcEngine.UltraCalcEngine.DisposeReferences()
at Infragistics.Win.CalcEngine.UltraCalcEngine.ProcessTopologicalEvent(QueueInfo item)
at Infragistics.Win.CalcEngine.UltraCalcEngine.CleanTopologicalEventQueue(Int64 ticks)
at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.Infragistics.Win.CalcEngine.IUltraCalcManager.ProcessEventQueue()
at Infragistics.Win.UltraWinGrid.RowsCollection.EnsureFiltersEvaluated()
at Infragistics.Win.UltraWinGrid.ScrollCountManagerSparseArray.VerifyAgainstScrollVersion()
at Infragistics.Win.UltraWinGrid.ScrollCountManagerSparseArray.get_VisibleCount()
at Infragistics.Win.UltraWinGrid.RowsCollection.GetVisibleRowCount(Boolean includeSpecialRows)
at Infragistics.Win.UltraWinGrid.RowsCollection.get_VisibleRowCount()
at Infragistics.Win.UltraWinGrid.UltraGridFilterRow.ApplyNewFiltersHelper(ColumnFilter origColumnFilter, ColumnFilter newColumnFilter, UltraGridFilterRow filterRow, Boolean fireFilterCellValueChangedEvent, RowsCollection rows)
at Infragistics.Win.UltraWinGrid.UltraGridFilterRow.ApplyNewFiltersHelper(ColumnFilter origColumnFilter, ColumnFilter newColumnFilter, UltraGridFilterRow filterRow, RowsCollection rows)
at Infragistics.Win.UltraWinGrid.UltraGridFilterRow.ApplyFilters(UltraGridColumn column, Boolean commitEditValues)
at Infragistics.Win.UltraWinGrid.UltraGridFilterCell.ApplyFilters()
Hi,
Can you post a small sample project that works in 12.2 and fails in 13.2? If so, we could check it out and look for a fix or a workaround.
Hi Mike. Thanks for the reply.
I created a 13.2 sample project that as closely as possible demonstrates how we are using the ultra grid. Curiously, in the place where we get the index out of bounds exception, the sample project just hangs. But regardless I think it's adequate enough for demonstration purposes. The form itself contains instructions for running.
When I changed the references to point to 12.1 (sorry my initial post i accidentally said we were running 12.2, it's 12.1) while we see no issues in our application, I'm getting the same behavior as 13.2 I can't really explain why at this point, but I'm hopeful the example running against 13.2 is enough for you to go on. If it's not let me know and I will continue tweaking.
Thanks
Hi Chris,
I will try to take a look at your sample, but it would really be better if you had a sample duplicating the exception. The thing is, using Filtering and FormulaRowIndexSource.VisibleIndex can create a logical contradiction. Filtering bases the visibility of the row on a value of a cell, and the formula calculations will base the value of a cell or summary on the visibility of the row. So you can end up going on circles, which is why we generally recommend that you don't use VisibleIndex if you are doing filtering.
So solving the problem in the sample you provided here may not help you with your real issue, since they are not the same issue.
I'd be more than happy to set the FormulaRowIndexSource to RowIndex when filters are turned on. But as you can see in my example this renders my custom summary useless because it doesn't exclude the filtered out rows in it's calculation (like it does for the "standard" summary types like sum and max).
This would seem to imply that filtering is basically forbidden if you're using a custom (formula) summary. And if that's the answer I'm going to have a hard time explaining that to my manager.
I am just checking about the progress of this issue. Did Mike's suggestion helped you solve your issue? Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.