This question is locked. New answers and comments are not allowed.
We've been following this pattern for quite a while now and until recently, it had worked flawlessly.
http://blogs.telerik.com/rossenhristov/posts/09-11-27/pre-filtering-radgridview-for-silverlight.aspx
http://www.telerik.com/help/silverlight/radgridview-filtering-column-filter-descriptors.html
Our code is as follows (gridSettings.GridFilterSettings is our own custom collection that we use to track all possible filters):
The filtering event is raised to handle the translation from a grid filter to a DomainDataSource filter.
Now we receive this white screen exception when implementing the code:
I narrowed it down to when the filter descriptor is added to the grid itself. If I comment out that line, no exception.
Here is an XML representation example of the columnFilter above:
{( (Empty) AND (( (MenuLinkCode IsEqualTo DW ) )) )}
We are using version 2011.3.1116.1040
Any ideas?
http://blogs.telerik.com/rossenhristov/posts/09-11-27/pre-filtering-radgridview-for-silverlight.aspx
http://www.telerik.com/help/silverlight/radgridview-filtering-column-filter-descriptors.html
Our code is as follows (gridSettings.GridFilterSettings is our own custom collection that we use to track all possible filters):
'create the telerik filters
For
Each
filterSetting
As
ListPageGridSettings.FilterSetting
In
gridSettings.GridFilterSettings
Dim
newFilter
As
New
Telerik.Windows.Data.FilterDescriptor(filterSetting.FilterPropertyPath, filterSetting.FilterOperator, filterSetting.FilterValue)
'add if this column is on this grid
If
grd.Columns(filterSetting.FilterColumn) IsNot
Nothing
Then
'add direct to the grid to allow to be cleared
Dim
columnFilter
As
New
Telerik.Windows.Controls.GridView.ColumnFilterDescriptor(
DirectCast
(grd.Columns(filterSetting.FilterColumn), Telerik.Windows.Data.IDataFieldDescriptor))
If
filterSetting.IsFilter1
Then
columnFilter.FieldFilter.Filter1.Operator = filterSetting.FilterOperator
columnFilter.FieldFilter.Filter1.Value = filterSetting.FilterValue
'now add to grid, DDS
addedFilters.Add(newFilter)
grd.FilterDescriptors.Add(columnFilter)
ElseIf
filterSetting.FilterValue IsNot Telerik.Windows.Data.FilterDescriptor.UnsetValue
Then
columnFilter.FieldFilter.Filter2.Operator = filterSetting.FilterOperator
columnFilter.FieldFilter.Filter2.Value = filterSetting.FilterValue
'now add to grid, DDS
addedFilters.Add(newFilter)
grd.FilterDescriptors.Add(columnFilter)
End
If
End
If
Next
'fire the filtering event of the grid to load data and apply filters
If
addedFilters.Count > 0
Then
grd.OnFiltering(
New
Telerik.Windows.Controls.GridView.GridViewFilteringEventArgs(addedFilters,
New
Telerik.Windows.Data.IFilterDescriptor() {}))
End
If
The filtering event is raised to handle the translation from a grid filter to a DomainDataSource filter.
Now we receive this white screen exception when implementing the code:
Error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Type memberType)
at Telerik.Windows.Data.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpressionOverride()
at Telerik.Windows.Data.Expressions.MemberAccessExpressionBuilderBase.CreateMemberAccessExpression()
at Telerik.Windows.Data.Expressions.FilterDescriptorExpressionBuilder.CreateMemberExpression()
at Telerik.Windows.Data.Expressions.FilterDescriptorExpressionBuilder.CreateBodyExpression()
at Telerik.Windows.Data.FilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
at Telerik.Windows.Data.FilterDescriptorBase.CreateFilterExpression(Expression instance)
at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
at Telerik.Windows.Data.CompositeFilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
at Telerik.Windows.Data.FilterDescriptorBase.CreateFilterExpression(Expression instance)
at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
at Telerik.Windows.Data.CompositeFilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
at Telerik.Windows.Data.FilterDescriptorBase.CreateFilterExpression(Expression instance)
at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
at Telerik.Windows.Data.CompositeFilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
at Telerik.Windows.Data.FilterDescriptorBase.CreateFilterExpression(Expression instance)
at Telerik.Windows.Data.CompositeFilterDescriptorCollection.CreateFilterExpression(Expression instance)
at Telerik.Windows.Data.ICompositeFilterDescriptorExtensions.GetFilterFunction(ICompositeFilterDescriptor filterDescriptors, Type itemType)
at Telerik.Windows.Data.QueryableCollectionView.InitializeInternalList(IQueryable view)
at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
at Telerik.Windows.Data.QueryableCollectionView.GetEnumerator()
at Telerik.Windows.Data.DataItemCollection.GetFlatEnumerator()
at Telerik.Windows.Data.DataItemCollection.GetEnumerator()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.EnsureItems()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
Source File:
Line: 59
I narrowed it down to when the filter descriptor is added to the grid itself. If I comment out that line, no exception.
Here is an XML representation example of the columnFilter above:
{( (Empty) AND (( (MenuLinkCode IsEqualTo DW ) )) )}
We are using version 2011.3.1116.1040
Any ideas?