This question is locked. New answers and comments are not allowed.
Hello,
I am using Telerik WPF RadGridView with Data Access ORM and data virtualization.
I bind my grid to virtualized collection, that I create with code similar to this:
When I try to group data by a column in the grid, the data is being grouped, but expanding the group throws null reference exception:
An unhandled exception of type 'System.NullReferenceException' occurred in Telerik.OpenAccess.35.Extensions.dll
Additional information: Object reference not set to an instance of an object.
If I remove "Select" clause from LINQ expression, it works good, so the exception appears only when I convert entity type to anonymous type.
In-memory scenario (converting IQueryable to List) also works.
SQL Profiler shows that sql query for expanded section has been queried just before the crash, and the query returns correct data.
Entity in FluentContext is mapped as artificial type.
Telerik Data Acces version is 2015.2.624.1
Stack Trace:
at Telerik.OpenAccess.Query.TypedEnumerator`1.ObtainCurrent()
at Telerik.OpenAccess.Query.TypedEnumerator`1.get_Current()
at Telerik.OpenAccess.Query.CachingEnumerator`1.MoveNext()
at Telerik.OpenAccess.Query.GroupingImpl`2.ResolveMemory()
at Telerik.OpenAccess.Query.GroupingImpl`2.GetEnumerator()
at Telerik.OpenAccess.Query.GroupingImpl`2.System.Collections.IEnumerable.GetEnumerator()
at Telerik.Windows.Data.KeyedCollection.AddRange(IEnumerable items)
at Telerik.Windows.Data.KeyedCollection..ctor(IEnumerable items, Func`2 keyFunction, Func`3 sortComparerFunc)
at Telerik.Windows.Data.QueryableCollectionViewGroup.Load()
at Telerik.Windows.Data.QueryableCollectionViewGroup.EnsureItems()
at Telerik.Windows.Data.QueryableCollectionViewGroup.get_Items()
at Telerik.Windows.Controls.GridView.QueryableCollectionViewGroupExtensions.GetRowItemsAtRange(QueryableCollectionViewGroup group, Int32 startIndex, Int32 rowItemsRemainingCount, Func`2 isGroupExpandedFunc, Boolean showGroupFooters, IDictionary`2 rowCountCache)
at Telerik.Windows.Controls.GridView.QueryableCollectionViewGroupExtensions.GetRowItemsAtRange(QueryableCollectionViewGroup group, Int32 startIndex, Int32 rowItemsRemainingCount, Func`2 isGroupExpandedFunc, Boolean showGroupFooters, IDictionary`2 rowCountCache)
at Telerik.Windows.Controls.GridView.Rows.GetRowItemsAtRange(Int32 startIndex, Int32 endIndex)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.RealizeRows(Int32 startIndex, Int32 endIndex, Double& verticalOffset, HashSet`1& realizedRows)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.MeasureOverride(Size availableSize)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
...
I am using Telerik WPF RadGridView with Data Access ORM and data virtualization.
I bind my grid to virtualized collection, that I create with code similar to this:
collection =
new
VirtualQueryableCollectionView(context
.GetAll(
"FluentModel.MyTable"
)
.Select(
"new (id, p1, p2)"
)
.OrderBy(
"id"
))
{ LoadSize = 10 };
When I try to group data by a column in the grid, the data is being grouped, but expanding the group throws null reference exception:
An unhandled exception of type 'System.NullReferenceException' occurred in Telerik.OpenAccess.35.Extensions.dll
Additional information: Object reference not set to an instance of an object.
If I remove "Select" clause from LINQ expression, it works good, so the exception appears only when I convert entity type to anonymous type.
In-memory scenario (converting IQueryable to List) also works.
SQL Profiler shows that sql query for expanded section has been queried just before the crash, and the query returns correct data.
Entity in FluentContext is mapped as artificial type.
Telerik Data Acces version is 2015.2.624.1
Stack Trace:
at Telerik.OpenAccess.Query.TypedEnumerator`1.ObtainCurrent()
at Telerik.OpenAccess.Query.TypedEnumerator`1.get_Current()
at Telerik.OpenAccess.Query.CachingEnumerator`1.MoveNext()
at Telerik.OpenAccess.Query.GroupingImpl`2.ResolveMemory()
at Telerik.OpenAccess.Query.GroupingImpl`2.GetEnumerator()
at Telerik.OpenAccess.Query.GroupingImpl`2.System.Collections.IEnumerable.GetEnumerator()
at Telerik.Windows.Data.KeyedCollection.AddRange(IEnumerable items)
at Telerik.Windows.Data.KeyedCollection..ctor(IEnumerable items, Func`2 keyFunction, Func`3 sortComparerFunc)
at Telerik.Windows.Data.QueryableCollectionViewGroup.Load()
at Telerik.Windows.Data.QueryableCollectionViewGroup.EnsureItems()
at Telerik.Windows.Data.QueryableCollectionViewGroup.get_Items()
at Telerik.Windows.Controls.GridView.QueryableCollectionViewGroupExtensions.GetRowItemsAtRange(QueryableCollectionViewGroup group, Int32 startIndex, Int32 rowItemsRemainingCount, Func`2 isGroupExpandedFunc, Boolean showGroupFooters, IDictionary`2 rowCountCache)
at Telerik.Windows.Controls.GridView.QueryableCollectionViewGroupExtensions.GetRowItemsAtRange(QueryableCollectionViewGroup group, Int32 startIndex, Int32 rowItemsRemainingCount, Func`2 isGroupExpandedFunc, Boolean showGroupFooters, IDictionary`2 rowCountCache)
at Telerik.Windows.Controls.GridView.Rows.GetRowItemsAtRange(Int32 startIndex, Int32 endIndex)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.RealizeRows(Int32 startIndex, Int32 endIndex, Double& verticalOffset, HashSet`1& realizedRows)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.MeasureOverride(Size availableSize)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
...