Skip to content

Commit a1f7a2d

Browse files
committed
Sample(GH-3557): Custom binding sample in datagrid
1 parent c7d7f0f commit a1f7a2d

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

Blazor_Server/Custom_binding/Pages/Index.razor

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<SfGrid TValue="Order" ID="Grid" AllowGrouping="true" AllowSorting="true" AllowFiltering="true" AllowPaging="true"
66
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })">
77
<SfDataManager AdaptorInstance="@typeof(GridCustomDataAdaptor)" Adaptor="Adaptors.CustomAdaptor"/>
8+
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Excel" />
89
<GridPageSettings PageSize="8"/>
910
<GridEditSettings AllowEditing="true" AllowDeleting="true" AllowAdding="true" AllowEditOnDblClick="true" Mode="@EditMode.Normal"/>
1011
<GridAggregates>
@@ -22,20 +23,6 @@
2223
</GridAggregateColumn>
2324
</GridAggregateColumns>
2425
</GridAggregate>
25-
<GridAggregate>
26-
<GridAggregateColumns>
27-
<GridAggregateColumn Field=@nameof(Order.Freight) Type="AggregateType.Average" Format="C2">
28-
<FooterTemplate>
29-
@{
30-
var aggregate = (context as AggregateTemplateContext);
31-
<div>
32-
<p>Average: @aggregate?.Average</p>
33-
</div>
34-
}
35-
</FooterTemplate>
36-
</GridAggregateColumn>
37-
</GridAggregateColumns>
38-
</GridAggregate>
3926
</GridAggregates>
4027
<GridColumns>
4128
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="@TextAlign.Center" Width="140"/>
@@ -44,4 +31,3 @@
4431
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Width="150" TextAlign="@TextAlign.Center"/>
4532
</GridColumns>
4633
</SfGrid>
47-

Blazor_WebAssembly/Grid_Custom_Binding/Pages/Index.razor

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<SfGrid TValue="Order" ID="Grid" AllowGrouping="true" AllowSorting="true" AllowFiltering="true" AllowPaging="true"
44
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })">
55
<SfDataManager AdaptorInstance="@typeof(GridCustomDataAdaptor)" Adaptor="Adaptors.CustomAdaptor"/>
6+
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Excel" />
67
<GridPageSettings PageSize="8"/>
78
<GridEditSettings AllowEditing="true" AllowDeleting="true" AllowAdding="true" AllowEditOnDblClick="true" Mode="@EditMode.Normal"/>
89
<GridAggregates>
@@ -20,20 +21,6 @@
2021
</GridAggregateColumn>
2122
</GridAggregateColumns>
2223
</GridAggregate>
23-
<GridAggregate>
24-
<GridAggregateColumns>
25-
<GridAggregateColumn Field=@nameof(Order.Freight) Type="AggregateType.Average" Format="C2">
26-
<FooterTemplate>
27-
@{
28-
var aggregate = (context as AggregateTemplateContext);
29-
<div>
30-
<p>Average: @aggregate?.Average</p>
31-
</div>
32-
}
33-
</FooterTemplate>
34-
</GridAggregateColumn>
35-
</GridAggregateColumns>
36-
</GridAggregate>
3724
</GridAggregates>
3825
<GridColumns>
3926
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="@TextAlign.Center" Width="140"/>

0 commit comments

Comments
 (0)