Hello,
I upgraded to Syncfusion.Blazor.DropDowns (>= 20.2.0.40) and I started receiving
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.DropDowns.SfMultiSelect`2[[System.String[], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Model, Ui.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<UpdateListSelection>b__674_0(ListOptions`1 item)
at System.Linq.Enumerable.WhereListIterator`1[[Syncfusion.Blazor.DropDowns.ListOptions`1[[Models.l, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Syncfusion.Blazor.DropDowns, Version=20.2.0.40, Culture=neutral, PublicKeyToken=null]].MoveNext()
at System.Linq.Enumerable.TryGetFirst[ListOptions`1](IEnumerable`1 source, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[ListOptions`1](IEnumerable`1 source)
Here is my code:
<div class="col-lg-12 control-section">
<div class="content-wrapper">
<div class="row">
<h6>Select Ship City</h6>
<SfMultiSelect ref="@ShipMultiSelect" TValue="string[]" @bind-Value="@ImpactValue" TItem="OrderDetails" Placeholder="Select Ship CIty" DataSource="@Orders" AllowCustomValue="false" Mode="@VisualMode.CheckBox" ShowClearButton="true" ShowSelectAll="true">
<MultiSelectFieldSettings GroupBy="EmployeeID" Text="ShipCity" Value="ShipCity"></MultiSelectFieldSettings>
</SfMultiSelect>
</div>
</div>
</div>
@code {
public List<OrderDetails> Orders { get; set; }
private string[] ImpactValue { get; set; } = Array.Empty<string>();
public SfMultiSelect<string[], OrderDetails> ShipMultiSelect { get; set; } = new();
protected override void OnInitialized()
{
base.OnInitialized();
Orders = Enumerable.Range(1, 100).Select(x => new OrderDetails()
{
OrderID = 10240 + x,
CustomerName = new string[] { "VINET", "TOSMP", "HANAR", "VICTE" }[new Random().Next(4)],
EmployeeID = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }[new Random().Next(10)],
Freight = new float[] { 32.28f, 22.90f, 30.99f, 50.52f }[new Random().Next(4)],
ShipCity = new string[] { "Reims", "Munster", "Rio de Janeir", "Lyon" }[new Random().Next(4)],
}).ToList();
}
public class OrderDetails
{
[Key]
[Display(Name = "Order ID")]
[Required(ErrorMessage = "Order ID is required")]
public int? OrderID { get; set; }
[Display(Name = "Customer ID")]
[Required(ErrorMessage = "Customer ID is required")]
[StringLength(8, MinimumLength = 3, ErrorMessage = "Customer ID length should between 3 and 8")]
public string CustomerName { get; set; }
[Display(Name = "Employee ID")]
[Range(1, 10, ErrorMessage = "Employee ID should be between 1 and 10")]
public int EmployeeID { get; set; }
[DisplayFormat(DataFormatString = "c2")]
[Range(1, 1000, ErrorMessage = "Freight should be between 1 and 1000")]
public float Freight { get; set; }
[Display(Name = "Ship City")]
[Editable(false)]
public string ShipCity { get; set; }
}
}
What is wrong with the following code and why is it giving me a null error?
if i downgrade to 20.2.0.36 the code works
Hi Pavel,
We are validating the requirement. We will update the details in two business days (2nd August 2022).
Regards,
Udhaya Kumar D
Hi Pavel,
We were able to reproduce the reported issue from our end. We will update the details in two business days (4th August 2022).
Regards,
Udhaya Kumar D
Hi Pavel
Already we have considered the issue “Grouping not working properly on multiselect component” as a bug from our end and the fix for the issue will be included in our Volume 2 SP1 release. The volume 2 SP1 will be released in the middle of august 2022.
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link:
https://www.syncfusion.com/feedback/36645/grouping-not-working-properly-on-multiselect-component
Regards,
Udhaya Kumar D
Hi Pavel,
We are glad to announce that our Essential Studio 2022 Volume 2 SP
release v20.2.0.43 is rolled out and is available for download under the
following link.
We have also included the fix for the issue "Grouping not working properly on multiselect component" with our Vol 2 2022 SP release. So, please upgrade your package to the latest to resolve the issue from your end.
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you require any further assistance.
Regards,
Udhaya Kumar D