@using Syncfusion.EJ2.Blazor.Grids
<EjsGrid @ref="DefaultGrid" AllowGrouping="true" AllowSorting="true" AllowFiltering="true" DataSource="@Orders" AllowPaging="true">
<GridEvents OnActionComplete="OnComplete" TValue="Order"></GridEvents>
. . . . . . . . . .. . . . .
</EjsGrid>
@code{
EjsGrid<Order> DefaultGrid { get; set; }
public List<Order> Orders { get; set; }
public async Task OnComplete(ActionEventArgs<Order> Args)
{
var FilterApplied = DefaultGrid.FilterSettings.Columns; // to get filtered column details
var GroupingApplied = DefaultGrid.GroupSettings.Columns; // to get grouped column details
var SortingApplied = DefaultGrid.SortSettings.Columns; // to get sorted column details
var Columns = await DefaultGrid.GetColumns(); // to get columsn details like visibility and other properties
} |
<EjsButton OnClick="Ch">Filtering</EjsButton>
<EjsButton OnClick="Group">Grouping</EjsButton>
<EjsButton OnClick="Sort">Sorting</EjsButton>
<EjsGrid @ref="Grid" DataSource="@Orders" Query="@Qry" AllowFiltering="true" AllowGrouping="true" AllowSorting="true" AllowPaging="true">
. … . . . . . . .
</EjsGrid>
@code{ . . . . . .. . . .
public async void Sort()
{
await Grid.SortColumn("OrderID", SortDirection.Descending);
}
public async void Group()
{
await Grid.GroupColumn("CustomerID");
}
. .. . .. .. .
}
|