Hi Radzen Team,
I want to report an issue encountered with the RadzenDataGrid Component 7.0.0 upon entering filter text, which results in an unhandled exception. The details are as follows:
Exception Details:
Unhandled exception: Value cannot be null. (Parameter 'type'): System.ArgumentNullException: Value cannot be null. (Parameter 'type')
at Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
at Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException
This issue occurs irrespective of the filter mode used (Advanced, Simple, or SimpleWithMenu). The datagrid is bound to an IEnumerable<IDictionary<string, string?>>.
Here's how my datagrid looks like:
<RadzenDataGrid @ref="_volumeGrid" LoadData="@LoadDataAsync" ColumnWidth="250px" AllowColumnReorder="true" AllowFiltering="true" AllowColumnResize="true" FilterMode="FilterMode.SimpleWithMenu" AllowSorting="true" Data="@_activeVolumeRecords" TItem="IDictionary<string, string?>" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" LogicalFilterOperator="LogicalFilterOperator.And" AllowVirtualization="true" Style="position: relative; height: 100%" SelectionMode="DataGridSelectionMode.Single" Count="@_count" AllowColumnPicking="true" ColumnsPickerAllowFiltering="true" AllowMultiColumnSorting=true RowSelect=@(args => OnRowSelect(args)) CellContextMenu="@OnCellContextMenu" Filter="@(args => OnFilterSet(args))" FilterCleared="@(args => OnFilterCleared(args))" Sort="@OnSort">
@{
int initialVisbleColumnCounter = 0;
foreach (DataColumn c in _volumeDataTable.Columns)
{
bool isVisible = true;
if (c.ColumnName.ToLower() != "docid" && initialVisbleColumnCounter > 10)
{
isVisible = false;
}
if (c.ColumnName != "InternalID")
{
<RadzenDataGridColumn Visible="@isVisible" Type="typeof(string)" TItem="IDictionary<string, string?>" Context="data" Property="@c.ColumnName" Title="@c.ColumnName">
<Template>
<div data-parent-row-id="@(data[_intIdColumnName])" title="@(data[c.ColumnName])"> @(data[c.ColumnName])</div>
</Template>
</RadzenDataGridColumn>
}
initialVisbleColumnCounter += 1;
}
}
</Columns>
This has been functioned correctly up to Radzen Component version 6.6.3. However, upon upgrading to version 7.0.0, this issue arose. It may be related to the breaking change mentioned in the release notes regarding the removal of the Microsoft.CodeAnalysis dependency, which was replaced with Radzen's own ExpressionParser.
Additionally, a similar error was encountered in the exception logs, though it occurred only once, and the trigger is uncertain:
Additional Exception Details:
Unhandled exception: Value cannot be null. (Parameter 'type'): System.ArgumentNullException: Value cannot be null. (Parameter 'type')
at System.ArgumentNullException.Throw(String paramName)
at System.Linq.Expressions.Expression.Property(Expression expression, Type type, String propertyName)
at Radzen.QueryableExtension.GetNestedPropertyExpression(Expression expression, String property, Type type)
at Radzen.QueryableExtension.GetExpression[T](ParameterExpression parameter, FilterDescriptor filter, FilterCaseSensitivity filterCaseSensitivity, Type type)
at Radzen.QueryableExtension.ToFilterString[T](IEnumerable1 columns) at Radzen.Blazor.RadzenDataGrid1.InvokeLoadData(Int32 start, Int32 top)
at Radzen.Blazor.RadzenDataGrid1.ReloadInternal() at Radzen.Blazor.RadzenDataGrid1.OnSort(EventArgs args, RadzenDataGridColumn`1 column)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Stack Trace:
at System.ArgumentNullException.Throw(String paramName)
at System.Linq.Expressions.Expression.Property(Expression expression, Type type, String propertyName)
at Radzen.QueryableExtension.GetNestedPropertyExpression(Expression expression, String property, Type type)
at Radzen.QueryableExtension.GetExpression[T](ParameterExpression parameter, FilterDescriptor filter, FilterCaseSensitivity filterCaseSensitivity, Type type)
at Radzen.QueryableExtension.ToFilterString[T](IEnumerable1 columns) at Radzen.Blazor.RadzenDataGrid1.InvokeLoadData(Int32 start, Int32 top)
at Radzen.Blazor.RadzenDataGrid1.ReloadInternal() at Radzen.Blazor.RadzenDataGrid1.OnSort(EventArgs args, RadzenDataGridColumn`1 column)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Could you please provide guidance on how to troubleshoot this issue?
Thank you for your attention to this issue!
