Assuming you have a column with ints and string, clicking on the header on the column to sort it will throw a System.ArgumentException: Object must be of type Int32.
π» Repro or Code Sample
<FluentDataGrid Items="@people">
<PropertyColumn Property="@(p => p.O)" Sortable="true" />
</FluentDataGrid>
@code {
record Person(object O);
IQueryable<Person> people = new[]
{
new Person(10895),
new Person(10944),
new Person(""),
}.AsQueryable();
}
π€ Expected Behavior
Not sure, but the component should probably not crash.
π― Current Behavior
Blank page with an error
π Possible Solution
I suppose it can be considered as a mistake of the developer to have mixed types in a sortable column so maybe the exception should be caught and the sort canceled.
π¦ Context
I have a table of logs, and some logs may not contain all the fields so a "" value is used. I realize that a null value work around the issue.
π Your Environment
OS & Device: Windows
Browser Google Chrome
.NET and Fluent UI Blazor library Version: 8.0.4 and 4.6.1
Yeah, I don't think we are going to cater for that. It is indeed a mistake of the developer which they can (and should) work around. Canceling the sort is not that easy
π Bug Report
Assuming you have a column with ints and string, clicking on the header on the column to sort it will throw a
System.ArgumentException: Object must be of type Int32.
π» Repro or Code Sample
π€ Expected Behavior
Not sure, but the component should probably not crash.
π― Current Behavior
Blank page with an error
π Possible Solution
I suppose it can be considered as a mistake of the developer to have mixed types in a sortable column so maybe the exception should be caught and the sort canceled.
π¦ Context
I have a table of logs, and some logs may not contain all the fields so a
""
value is used. I realize that anull
value work around the issue.π Your Environment