A DataGrid Column with a width value entered as a percentage string is throwing errors.
This is happening with a .net8 project and Syncfusion version 24.1.41 (and above)
<GridColumn Field=@nameof(MessageModel.Title)
HeaderText="Title"
TextAlign="TextAlign.Left"
ClipMode="ClipMode.EllipsisWithTooltip"
Width="18%" >
Error message in browser dev tools console:
invoke-js.ts:176 fail: Microsoft.AspNetCore.Components.Web.ErrorBoundary[0]
System.FormatException: The input string '18%' was not in a correct format.
at System.Number.ThrowFormatException[Char](ReadOnlySpan`1 value)
at System.Number.ParseFloat[Char,Double](ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
at System.Double.Parse(ReadOnlySpan`1 s, NumberStyles style, IFormatProvider provider)
at System.Double.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Double.Parse(String s, IFormatProvider provider)
---------------
System.FormatException: The input string '18%' was not in a correct format.
at System.Number.ThrowFormatException[Char](ReadOnlySpan`1 value)
at System.Number.ParseFloat[Char,Double](ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
at System.Double.Parse(ReadOnlySpan`1 s, NumberStyles style, IFormatProvider provider)
at System.Double.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Double.Parse(String s, IFormatProvider provider)
It only works if I define the Column's percentage value as a CustomAttribute:
<GridColumn Field=@nameof(MessageModel.Title)
HeaderText="Title"
TextAlign="TextAlign.Left"
ClipMode="ClipMode.EllipsisWithTooltip"
CustomAttributes="@(new Dictionary<string, object>(){ { "width", "18%"} })" >