Hi,
I have a RadzenDataGrid with a FilterTemplate with a RadzenCheckBox: when I click on the checkbox the LoadData event is triggered two times.
This behaviour doesn't happen when in the FilterTemplate I have a RadzendTextBox.
The grid:
<RadzenDataGrid @ref="_itemsGrid" AllowMultiColumnSorting="true" AllowFiltering="true" AllowPaging="true" AllowSorting="true" AllowColumnResize="true" ColumnWidth="300px"
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterMode="FilterMode.Simple"
TItem="ItemSearchDTO"
PageSize="15" Data="@_data" LoadData="@LoadData" Count="2">
<Columns>
<RadzenDataGridColumn Width="100px" TItem="ItemSearchDTO" Property="Element.Code" Title="DACode" Frozen="true" FilterOperator="FilterOperator.Contains" Sortable="true" Filterable="true">
<Template Context="item">
<a href=@($"items/{item.Id}")>@(!string.IsNullOrWhiteSpace(item.Code) ? item.Element.Code : "ND")</a>
</Template>
<FilterTemplate>
<label class="rz-cell-filter-label" style="height:35px">
<i class="rzi">search</i>
<RadzenTextBox Change="@(async args => { context.FilterValue = args; await OnChange(args); })"></RadzenTextBox>
</label>
</FilterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Width="80px" TItem="ItemSearchDTO" Property="Expired" Title="Expired" FilterOperator="FilterOperator.Equals" Sortable="true" Filterable="true">
<FilterTemplate>
<label class="rz-cell-filter-label" style="height:35px">
<i class="rzi">search</i>
<RadzenCheckBox TriState="true" TValue="bool?" Change="@(async args => { context.FilterValue = args; await OnChange(args); })" />
</label>
</FilterTemplate>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
The entity:
public class ItemSearchDTO
{
public string DACode {get; set;}
public bool Expired {get;set;}
}
The code behind:
private async Task LoadData(LoadDataArgs args)
{
var _data = new List<ItemSearchDTO>
{
new ItemSearchDTO
{
Code = "c1",
Expired = true,
},
new ItemSearchDTO
{
Code = "c2",
Expired = false,
}
};
}