Here is a grid that shows a bunch of users
<SfGrid DataSource="@allUsers" AllowPaging="true" AllowSorting="true" AllowFiltering="true">
<GridEvents CommandClicked="CommandClickHandler" TValue="User"></GridEvents>
<GridPageSettings PageSize="10" />
<GridColumns>
<GridColumn HeaderText="Edit" Width="75">
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Edit" Title="Edit User"
ButtonOption="@(new CommandButtonOptions()
{
CssClass="e-success",
IconCss = "fa fa-pencil",
})" />
</GridCommandColumns>
</GridColumn>
<GridColumn HeaderText="Delete" Width="75">
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Delete" Title="Delete User"
ButtonOption="@(new CommandButtonOptions()
{
CssClass="e-danger",
IconCss = "fa fa-trash",
})" />
</GridCommandColumns>
</GridColumn>
<GridColumn Field="@nameof(User.Status)" HeaderText="Status" Width="100" />
<GridColumn Field="@nameof(User.Id)" HeaderText="Id" TextAlign="TextAlign.Right" Width="100" />
<GridColumn Field="@nameof(User.OrgId)" HeaderText="Org ID" Width="150" />
</GridColumns>
</SfGrid>
Here is the user object:
public enum UserStatus
{
Active = 0,
Disabled = -1
}
[Table("User")]
public class User : BaseModel
{
// ....
public UserStatus Status { get; set; } = UserStatus.Active;
// ....
}
If I enter anything in the filter grid OTHER THAN "Active" or "Disabled", the application crashes.
E.g. - see attached screenshot.
The Exception is:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Syncfusion.Blazor
StackTrace:
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.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Syncfusion.Blazor.Data.BlazorAdaptor.<PerformDataOperation>d__4`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Syncfusion.Blazor.DataManager.<ExecuteQuery>d__147`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
This exception was originally thrown at this call stack:
Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(System.Collections.IEnumerable, System.Collections.Generic.List<Syncfusion.Blazor.Data.WhereFilter>, string, System.Linq.Expressions.ParameterExpression, System.Type)
Syncfusion.Blazor.Data.EnumerableOperation.PredicateBuilder(System.Collections.IEnumerable, System.Collections.Generic.List<Syncfusion.Blazor.Data.WhereFilter>, string, System.Linq.Expressions.ParameterExpression, System.Type)
Syncfusion.Blazor.Data.EnumerableOperation.PerformFiltering(System.Collections.IEnumerable, System.Collections.Generic.List<Syncfusion.Blazor.Data.WhereFilter>, string)
Syncfusion.Blazor.Data.BlazorAdaptor.DataOperationInvoke<T>(System.Collections.IEnumerable, Syncfusion.Blazor.DataManagerRequest)
Syncfusion.Blazor.Data.BlazorAdaptor.PerformDataOperation.AnonymousMethod__0()
System.Threading.Tasks.Task<TResult>.InnerInvoke()
System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, object)
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task, System.Threading.Thread)
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
...
[Call Stack Truncated]
Attachment:
sfgrid_crash_45e3bb21.7z