BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
I have an enum in my model. I want to apply the filter from a button for my component
if i click the button for that the filter will apply for the table
how i can this ?
if I click, so that it only leaves the rows with my enum value
Hi,
Greetings from Syncfusion support
We would like to inform that we have inbuilt method to perform filtering externally. By using FilterByColumnsAsync method we can perform filtering programmatically. We have also documented the topic in the below UG section. Kindly check the attached sample and code snippet for your reference.
Reference: https://blazor.syncfusion.com/documentation/datagrid/filtering#filter-enum-column
<Syncfusion.Blazor.Buttons.SfButton @onclick="Click">Filter</Syncfusion.Blazor.Buttons.SfButton> <SfGrid @ref="Grid" DataSource="@Orders" AllowFiltering="true"> <GridColumns>
</GridColumns> </SfGrid>
@code {
public enum FileType : short { Base = 1, Replace = 2, Delta = 3 } public async Task Click() { await this.Grid.FilterByColumnAsync("Type", "contains", FileType.Base); } } |
Please let us know if you have any concerns.
Regards,
Monisha