ListView with CheckBox

good morning, starting from the example on the Check list in Blazor ListView Component, which is on the site, If I try to change the IsChecked property of an item in the collection on the relative checkBox the check mark does not appear. Where am I doing wrong? I enclose the relative code and a screen


@page "/Test1"
 
@using Syncfusion.Blazor.Lists
<SfListView DataSource="@Data" ShowCheckBox="true">
    <ListViewFieldSettings TValue="DataModel" Id="Id" Text="Text" IsChecked="IsChecked"></ListViewFieldSettings>
</SfListView>
 
@code {
 
    private DataModel[] Data = {
 
        new DataModel { Text ="Hennessey Venom", Id = "list-01" },
        new DataModel { Text = "Bugatti Chiron", Id = "list-02", IsChecked = true },
        new DataModel { Text = "Bugatti Veyron Super Sport", Id = "list-03"},
        new DataModel { Text = "SSC Ultimate Aero", Id = "list-04" },
        new DataModel { Text = "Koenigsegg CCR", Id = "list-05" },
        new DataModel { Text = "McLaren F1", Id = "list-06" },
        new DataModel { Text = "Aston Martin One- 77", Id = "list-07" },
        new DataModel { Text = "Jaguar XJ220", Id = "list-08" },
        new DataModel { Text = "McLaren P1", Id = "list-09" },
        new DataModel { Text = "Ferrari LaFerrari", Id = "list-10" }
 
    };
 
    class DataModel
    {
        public string Text { getset; }
        public string Id { getset; }
        public bool IsChecked { getset; }
 
    }
 
    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        if (firstRender)
        {
            Data[0].IsChecked = true;
            Data[4].IsChecked = true;
            Data[9].IsChecked = true;
            StateHasChanged();
        }
    }
}

2 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team November 2, 2020 06:17 AM UTC

Hi Salvatore,  
 
Greetings from Syncfusion support.  
 
We have checked your reported problem with ListView component. This is already known issue from our end.   
  
We will include the fix for this issue in our first weekly patch release, which rolls out after Volume 3 SP release which is expected to be rolled out by mid of November, 2020.   
   
Please, track the following feedback link to know the status of this fix.  
   
  
We appreciate your patience.   
   
Regards,   
Sowmiya.P  



SP Sowmiya Padmanaban Syncfusion Team November 12, 2020 07:52 AM UTC

Hi Salvatore, 
 
Thanks for your patience. 
 
We are glad to announce that our patch release (V18.3.48) is rolled out successfully. In this release, we have included fix  for “Checked items is not maintained in ListView component”. To access this fix, we suggest you to update the package to the latest version (V18.3.48). 
 
Please, refer the below sample link for your requirement. 
 
 
Please get in touch with us if you would require any further assistance. 
 
Regards, 
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon