Hi LAID,
Greetings from Syncfusion,
Based on your requirement set Grid properties within the @code section of a
Razor page, you can bind these properties to variables and update them in your
C# code. Kindly refer to the below code snippet and sample for your reference,
|
@using
Syncfusion.Blazor.Grids
<SfGrid
TValue="Order" DataSource="Orders" AllowSorting="@AllowSorting" AllowFiltering="@AllowFiltering"
AllowExcelExport="@AllowExcelExport" PageSettings="@pageSettings"
EditSettings="@editSettings" FilterSettings="@filterSettings"
SelectionSettings="@selectionSettings">
</SfGrid>
@code
{
private bool
AllowSorting { get; set; } = true;
private bool
AllowFiltering { get; set; } = true;
private bool
AllowExcelExport { get; set; } = false;
private
GridPageSettings pageSettings { get; set; } = new GridPageSettings { PageSize
= 10 };
private
GridEditSettings editSettings { get; set; } = new GridEditSettings {
AllowAdding = true, AllowEditing = true, AllowDeleting = true };
private
GridFilterSettings filterSettings { get; set; } = new GridFilterSettings {
Type = Syncfusion.Blazor.Grids.FilterType.Menu };
private
GridSelectionSettings selectionSettings { get; set; } = new
GridSelectionSettings { Type = Syncfusion.Blazor.Grids.SelectionType.Single
};
}
|
Sample:https://blazorplayground.syncfusion.com/embed/BNLzMMhoAnFFMGYH?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5
Regards,
Prathap Senthil