If you freely search the input field displayed with "Allow Filtering = true", an error will occur if the search is caught in the column with "EditType.DropDownEdit" specified.
use code:
<SfGrid DataSource="List" AllowTextWrap="true" AllowFiltering="true" AllowSorting="true" AllowPaging="true" Toolbar="@(new List<string>() { "Edit", "Delete" })">
<GridSelectionSettings Mode="Syncfusion.Blazor.Grids.SelectionMode.Row" EnableToggle="false" EnableSimpleMultiRowSelection="false" />
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.CheckBox" />
<GridEvents OnActionBegin="ActionBegin" OnActionComplete="ActionComplete" TValue="DataValue" />
<GridPageSettings PageCount="5" PageSize="8" />
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" ShowDeleteConfirmDialog="true" AllowNextRowEdit="false" Mode="@EditMode.Dialog">
<HeaderTemplate>Data Value Information</HeaderTemplate>
</GridEditSettings>
<GridColumns>
<GridColumn Field="@nameof(DataValue.Id)" HeaderText="@nameof(DataValue.Id)" AllowEditing="@IsAddMode" IsPrimaryKey="true" EditType="EditType.NumericEdit"
EditorSettings="@(new NumericEditCellParams { Params = new() { CssClass = "e-required", Min = 1, ShowClearButton = true, ShowSpinButton = true, } })"
ValidationRules="@(new () { Required = true, })" />
<GridColumn Field="@nameof(DataValue.Name)" HeaderText="@nameof(DataValue.Name)" EditType="EditType.DefaultEdit"
EditorSettings="@(new StringEditCellParams { Params = new() { CssClass = "e-required", ShowClearButton = true, } })"
ValidationRules="@(new () { Required = true, })" />
<GridColumn Field="@nameof(DataValue.Key1)" HeaderText="@nameof(KeyValue1)" DataSource="KeySource1" EditType="EditType.DropDownEdit"
ForeignKeyField="@nameof(KeyValue1.Key)"
ForeignKeyValue="@nameof(KeyValue1.Name)"
EditorSettings="@(new DropDownEditCellParams{ Params = new() { ShowClearButton = true, PopupWidth="auto"} })" />
<GridColumn Field="@nameof(DataValue.Key2)" HeaderText="@nameof(KeyValue2)" DataSource="KeySource2" EditType="EditType.DropDownEdit"
ForeignKeyField="@nameof(KeyValue2.Key)"
ForeignKeyValue="@nameof(KeyValue2.Name)"
EditorSettings="@(new DropDownEditCellParams{ Params = new() { ShowClearButton = true, PopupWidth="auto" } })" />
</GridColumns>
</SfGrid>
probrem:
column KeyValue1 , KeyValue2
input hit text -> Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Data.EnumerableOperation.GetColumnType(IEnumerable dataSource, String filterString, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PerformFiltering(IEnumerable dataSource, List`1 whereFilter, String condition)
at Syncfusion.Blazor.Data.BlazorAdaptor.DataOperationInvoke[T](IEnumerable DataSource, DataManagerRequest queries)
at Syncfusion.Blazor.Data.BlazorAdaptor.<>c__DisplayClass4_0`1.<PerformDataOperation>b__0() at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at Syncfusion.Blazor.Data.BlazorAdaptor.PerformDataOperation[T](Object query)
at Syncfusion.Blazor.DataManager.ExecuteQuery[T](DataManagerRequest queries)
at Syncfusion.Blazor.DataManager.ExecuteQuery[T](Query query)
at Syncfusion.Blazor.Grids.Internal.FilterCheckBoxRenderer`1.UpdateDataSource(Boolean isInputSearch)
at Syncfusion.Blazor.Grids.Internal.FilterCheckBoxRenderer`1.InputArgs(ChangeEventArgs args)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'rAhG6JBXbZf9LagayOWMT8dcAiduQ2PT-TM-wzh_jXQ'.
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Data.EnumerableOperation.GetColumnType(IEnumerable dataSource, String filterString, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(IEnumerable dataSource, List`1 whereFilter, String condition, ParameterExpression paramExpression, Type type)
at Syncfusion.Blazor.Data.EnumerableOperation.PerformFiltering(IEnumerable dataSource, List`1 whereFilter, String condition)
at Syncfusion.Blazor.Data.BlazorAdaptor.DataOperationInvoke[T](IEnumerable DataSource, DataManagerRequest queries)
at Syncfusion.Blazor.Data.BlazorAdaptor.<>c__DisplayClass4_0`1.<PerformDataOperation>b__0() at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown --- at Syncfusion.Blazor.Data.BlazorAdaptor.PerformDataOperation[T](Object query)
at Syncfusion.Blazor.DataManager.ExecuteQuery[T](DataManagerRequest queries)
at Syncfusion.Blazor.DataManager.ExecuteQuery[T](Query query)
at Syncfusion.Blazor.Grids.Internal.FilterCheckBoxRenderer`1.UpdateDataSource(Boolean isInputSearch)
at Syncfusion.Blazor.Grids.Internal.FilterCheckBoxRenderer`1.InputArgs(ChangeEventArgs args)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
Attachment:
FilterErrorSample_20210326_508c5126.zip