We have a RadGrid with multiple columns. Two of the columns are Bound to some Lazy Loaded properties.
The first looks like this:
The other looks like this:
They are bound to different columns obviously but both are lazy loaded from the Contact table.
The first one (Portfolio Manager) Filters fine.
The second (Compliance Officer), when you Filter we get errors about Null Reference.
The error does not trigger any stoppage in Debug mode, it just goes straight back to the page and the Stack Trace doesn't touch any of our code.
I THINK the issue is that the second column can have NULLs, but I have no idea how to handle Null values on Lazy Loaded Bound objects.
Here is the Stacktrace:
The first looks like this:
<
telerik:GridBoundColumn
DataField
=
"Contact.FullName"
DataType
=
"System.String"
FilterControlAltText
=
"Filter Portfolio Manager column"
HeaderText
=
"Portfolio Manager"
HeaderButtonType
=
"TextButton"
SortExpression
=
"PortfolioManager"
UniqueName
=
"PortfolioManager"
FilterControlWidth
=
"60%"
>
<
HeaderStyle
CssClass
=
"GridHeaderControlColor"
Width
=
"25%"
/>
</
telerik:GridBoundColumn
>
The other looks like this:
<
telerik:GridBoundColumn
DataField
=
"Contact1.Fullname"
FilterControlAltText
=
"Filter Compliance Officer column"
SortExpression
=
"ComplianceOfficer"
HeaderText
=
"Compliance Officer"
HeaderButtonType
=
"TextButton"
UniqueName
=
"ComplianceOfficer"
DataType
=
"System.String"
FilterControlWidth
=
"60%"
>
<
HeaderStyle
CssClass
=
"GridHeaderControlColor"
Width
=
"20%"
/>
</
telerik:GridBoundColumn
>
They are bound to different columns obviously but both are lazy loaded from the Contact table.
The first one (Portfolio Manager) Filters fine.
The second (Compliance Officer), when you Filter we get errors about Null Reference.
The error does not trigger any stoppage in Debug mode, it just goes straight back to the page and the Stack Trace doesn't touch any of our code.
I THINK the issue is that the second column can have NULLs, but I have no idea how to handle Null values on Lazy Loaded Bound objects.
Here is the Stacktrace:
[NullReferenceException: Object reference not set to an instance of an object.]
lambda_method(Closure , PMD_ComplianceLoanAdminReport ) +62
System.Linq.WhereEnumerableIterator`1.MoveNext() +141
System.Linq.Enumerable.Count(IEnumerable`1 source) +225
lambda_method(Closure ) +149
System.Linq.EnumerableExecutor`1.Execute() +94
System.Linq.EnumerableExecutor`1.ExecuteBoxed() +23
System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +94
Telerik.Web.UI.GridDynamicQueryable.Count(IQueryable source) +296
Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +4216
Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +1064
Telerik.Web.UI.GridResolveEnumerable.Initialize() +58
Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +45
Telerik.Web.UI.GridResolveEnumerable.get_DataTable() +31
Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +221
Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +154
Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +566
Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +223
Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +622
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +800
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +66
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
Telerik.Web.UI.GridTableView.PerformSelect() +38
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
Telerik.Web.UI.GridTableView.DataBind() +363
Telerik.Web.UI.GridTableView.Rebind() +100
Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source) +954
Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +200
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +66
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +142
Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) +80
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +9998
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563