Skip to content

Commit

Permalink
DataFilter numeric input errors handled
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Dec 9, 2024
1 parent af20831 commit eb6dbf0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Radzen.Blazor/RadzenDataFilterItem.razor
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,21 @@ else
builder.AddAttribute(5, "oninput", EventCallback.Factory.Create<ChangeEventArgs>(this, args =>
{
var v = $"{args.Value}";
Filter.FilterValue = !string.IsNullOrWhiteSpace(v) ? Convert.ChangeType(v, Nullable.GetUnderlyingType(property.FilterPropertyType) ?? property.FilterPropertyType) : null;
if (!string.IsNullOrWhiteSpace(v))
{
try
{
Filter.FilterValue = Convert.ChangeType(v, Nullable.GetUnderlyingType(property.FilterPropertyType) ?? property.FilterPropertyType);
}
catch
{
Filter.FilterValue = null;
}
}
else
{
Filter.FilterValue = null;
}
}));
builder.CloseComponent();
});
Expand Down

0 comments on commit eb6dbf0

Please sign in to comment.