Skip to content

Commit 03cfe82

Browse files
authored
Merge pull request #9 from SyncfusionExamples/GH-3557-DataGrid
Sample(GH-3557): Custom binding sample in datagrid
2 parents c7d7f0f + 5c18a4a commit 03cfe82

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

Blazor_Server/Custom_binding/Pages/Index.razor

Lines changed: 4 additions & 10 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>
@@ -19,20 +20,14 @@
1920
</div>
2021
}
2122
</FooterTemplate>
22-
</GridAggregateColumn>
23-
</GridAggregateColumns>
24-
</GridAggregate>
25-
<GridAggregate>
26-
<GridAggregateColumns>
27-
<GridAggregateColumn Field=@nameof(Order.Freight) Type="AggregateType.Average" Format="C2">
28-
<FooterTemplate>
23+
<GroupFooterTemplate>
2924
@{
3025
var aggregate = (context as AggregateTemplateContext);
3126
<div>
32-
<p>Average: @aggregate?.Average</p>
27+
<p>Sum: @aggregate?.Sum</p>
3328
</div>
3429
}
35-
</FooterTemplate>
30+
</GroupFooterTemplate>
3631
</GridAggregateColumn>
3732
</GridAggregateColumns>
3833
</GridAggregate>
@@ -44,4 +39,3 @@
4439
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Width="150" TextAlign="@TextAlign.Center"/>
4540
</GridColumns>
4641
</SfGrid>
47-

Blazor_WebAssembly/Grid_Custom_Binding/Pages/Index.razor

Lines changed: 4 additions & 9 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>
@@ -17,20 +18,14 @@
1718
</div>
1819
}
1920
</FooterTemplate>
20-
</GridAggregateColumn>
21-
</GridAggregateColumns>
22-
</GridAggregate>
23-
<GridAggregate>
24-
<GridAggregateColumns>
25-
<GridAggregateColumn Field=@nameof(Order.Freight) Type="AggregateType.Average" Format="C2">
26-
<FooterTemplate>
21+
<GroupFooterTemplate>
2722
@{
2823
var aggregate = (context as AggregateTemplateContext);
2924
<div>
30-
<p>Average: @aggregate?.Average</p>
25+
<p>Sum: @aggregate?.Sum</p>
3126
</div>
3227
}
33-
</FooterTemplate>
28+
</GroupFooterTemplate>
3429
</GridAggregateColumn>
3530
</GridAggregateColumns>
3631
</GridAggregate>

0 commit comments

Comments
 (0)