Trouble updating from Version 18.2 to 18.3

I have this code in version 18.2

                    <SfListBox ID="pdfMissingBills" DataSource="@_pdfMissingBills" TValue="string[]" TItem="string">
                        <ListBoxSelectionSettings Mode="Syncfusion.Blazor.DropDowns.SelectionMode.Single"></ListBoxSelectionSettings>
                        <ListBoxEvents TValue="string[]" ValueChange="@ShowSupplierInvoice"></ListBoxEvents>
                    </SfListBox>

        private async Task ShowSupplierInvoice(ListBoxChangeEventArgs args)
        {
            var file = ((JArray)args.Value).ToObject<List<string>>()?.FirstOrDefault();
        }

This is not working after updating to Version 18.3, can you let me know what changes I need to make?

Many thanks, Stuart

1 Reply 1 reply marked as answer

MK Mohan Kumar Ramasamy Syncfusion Team November 2, 2020 06:15 AM UTC

Hi Stuart, 
 
Sorry for the inconvenience caused. In our latest version (v18.3.35), we have included some breaking changes in ListBox component. We would like you to review the breaking changes from the below location before you upgrade. 
 
We have changed event arguments as strongly type for Listbox Event . Could you please find the below code snippet. 
 
 
@using Syncfusion.Blazor.DropDowns 
 
<div class="col-lg-12 control-section"> 
    <div id="listbox-control"> 
        <h4>Select your favorite car:</h4> 
        <SfListBox DataSource="@Data" TValue="string[]" TItem="string"> 
            <ListBoxSelectionSettings Mode="Syncfusion.Blazor.DropDowns.SelectionMode.Single"></ListBoxSelectionSettings> 
            <ListBoxEvents TValue="string[]" TItem="string" ValueChange="@ShowSupplierInvoice"></ListBoxEvents> 
        </SfListBox> 
    </div> 
</div> 
@code 
{ 
  
    private string[] Data = new string[]  
    {  
        "Hennessey Venom",  
        "Bugatti Chiron",  
        "Bugatti Veyron Super Sport",  
        "SSC Ultimate Aero", 
        "Koenigsegg CCR", 
        "McLaren F1", 
        "Aston Martin One- 77", 
        "Jaguar XJ220", 
        "Ferrari LaFerrari" 
    }; 
 
    private void ShowSupplierInvoice(ListBoxChangeEventArgs<string[],string> args) 
    { 
        
    } 
} 
 
 
 For your reference, we have prepared a sample based on this. Please refer below link. 
 
 
Please, refer the following links to know more about SF Blazor List Box component    
   
  
Please let us know, if you need any further assistance. 
 
Regards, 
Mohan kumar R 


Marked as answer
Loader.
Up arrow icon