Multiple RadzenCheckBox in RadzenGrid

Hello,

I am working with the RadzenGrid and added a RadzenCheckbox to it. I then add a value from the context to a List on check/uncheck. All of this works as expected. However, once I click one checkbox in page 1, if I move to any other page inside the grid, that specific position still checked. Below is what I have.

     <RadzenGrid @ref="gridFiles" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterMode="FilterMode.Advanced" AllowPaging="true" PageSize="10"
                        AllowSorting="true" Data="@Files" TItem="Files" ColumnWidth="200px">
                <Columns>
                    <RadzenGridColumn TItem="Files" Property="Name" Title="Select for download" Filterable="false" Sortable="false">                         
                        <Template Context="data">
                            <div style='text-align:center'>
                                <RadzenCheckBox TValue="bool" Style="border:groove" Name="" Change="@(args => AddFileToList(data.Name, args))" />
                            </div>
                        </Template>
                        <FooterTemplate>
                            <div style="text-align:center">
                                <button class="btn btn-sm btn-outline-primary" @onclick="DownloadFiles"><i class="fas fa-download"></i> Download</button>
                            </div>
                        </FooterTemplate>
                    </RadzenGridColumn>
                    <RadzenGridColumn TItem="Files" Property="Date" Title="Date">
                        <Template Context="files">
                            @String.Format("{0:d}", files.Date)
                        </Template>
                        <FooterTemplate>
                            Showing <b>@gridFiles.View.Count()</b> of <b>@Files.Count()</b> records
                        </FooterTemplate>
                    </RadzenGridColumn>
                </Columns>
            </RadzenGrid>

Could this be done with the pagination event change or is there any other way?
Thank you!

Hi @ldscel,

You can try using the @key Blazor attribute:

<RadzenCheckBox @key=@data TValue="bool" Style="border:groove" Name="" Change="@(args => AddFileToList(data.Name, args))" />

@korchev, Thank you, that was an easy fix.
One more question in this regards, would it be possible to do a "Select All" option?
If I try to do it the way below, every single checkbox triggers the condition and files are not loaded to the list.
I wonder if this is even possible?
Thanks once again for the quick response. I appreciate!

<HeaderTemplate>
                    <div style='text-align:center'>
                        <label style="font-size: 16px !important; color:dodgerblue;">
                            <RadzenCheckBox TValue="bool" Style="border:groove" @bind- 
Value="@IsChecked" />
                            
                        </label>
                    </div>
                </HeaderTemplate>
              <Template Context="data">
                    <div style='text-align:center'>
                        <RadzenCheckBox TValue="bool" Style="border:groove" @bind- 
           Value="@IsChecked" @key=@data Change="@(args => 
         AddFileToList(data.Name, args))" />
                    </div>
                </Template>

When you use @bind-Value the property will update when you check the checkbox. You can try using Value only.