Skip to content

Commit 3f94b19

Browse files
committed
add group header aggregates alignment to docs
1 parent c24d449 commit 3f94b19

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

controls/datagrid/aggregates/overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ To show the Aggregates in the group header, set the `ShowGroupHeaderAggregates`
4242

4343
![DataGrid Group Header Aggregate](../images/datagrid-group-header-aggregate.png)
4444

45+
To align the aggregates in the group according to its header set the `GroupAggregatesAlignment` (`enum` of type `Telerik.Maui.Controls.DataGrid.DataGridGroupAggregatesAlignment`) property. The available options are:
46+
47+
* (default)`None`—Aggregates are not aligned to the DataGrid columns. The aggregates results are displayed after the text displayed for the group key.
48+
* `NextToHeader`—Aggregate results are aligned to the DataGrid columns and placed next to the header of the group.
49+
4550
### Aggregates in Group Footer
4651

4752
When [grouping]({%slug datagrid-grouping-overview %}) is applied to the DataGrid, you can display the aggregate results for the groups data in the group footer.

controls/datagrid/aggregates/styling.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ Use the following properties to style the `GroupHeader`:
3636

3737
### Style the Aggregates in the Group Header
3838

39-
You can style the appearance of the aggregate results in the group header by setting the following properties to the `GroupHeaderStyle`:
39+
You can style the appearance of the aggregate results based on the value of the `GroupAggregatesAlignment` (`enum` of type `Telerik.Maui.Controls.DataGrid.DataGridGroupAggregatesAlignment`) property.
40+
41+
To style the aggregates in the group header when the value for the `GroupAggregatesAlignment` is `None`, use the `GroupHeaderStyle` (of type `Style` with target type `DataGridGroupHeaderAppearance`) property.
42+
43+
The available properties in the `GroupHeaderStyle` are:
4044

4145
| Property | Description |
4246
| ------ | ------ |
@@ -50,6 +54,67 @@ The following example shows how to style the aggregate results in the group head
5054

5155
<snippet id='datagrid-group-header-aggregate-styling-example'/>
5256

57+
To style and customize the aggregate results when setting the `GroupAggregatesAlignment` to `NextToHeader`, use the following properties:
58+
59+
* `GroupAggregateCellStyle` (of type `Style` with target type `DataGridGroupAggregateCellAppearance`)&mdash;Defines the style of the aggregates cell within the group header of the DataGrid.
60+
* `GroupAggregateCellStyleSelector` (`IStyleSelector`)&mdash;Allows you to set different styles for each aggregate within the group header of the DataGrid by passing the `GroupAggregateCellContext` in the selector.
61+
* `GroupAggregateCellTemplate` (`DataTemplate`)&mdash;Defines the appearance of each aggregate within the group header of the DataGrid.
62+
63+
> The properties listed above are properties inside the `RadDataGrid` instance.
64+
The table below describes the available properties for the `GroupAggregateCellStyle`:
65+
66+
| Property | Description |
67+
| ------ | ------ |
68+
| `TextColor` | Defines the color of the cell text. |
69+
| `FontAttributes` | Defines the font attributes for the text in the cell. |
70+
| `FontFamily` | Defines the font family for the text in the cell. |
71+
| `FontSize` | Defines the size for the text in the cell. |
72+
| `Margin` | Defines the margin that is applied to the text of the cell. |
73+
74+
#### Example with the `GroupAggregateCellStyle`
75+
76+
**1.** Define the DataGrid in XAML:
77+
78+
<snippet id='datagrid-group-header-aggregates'/>
79+
80+
**2.** Define the `GroupAggregateCellStyle` in the page's resources:
81+
82+
<snippet id='datagrid-group-header-aggregate-nexttoheader-style-xaml'/>
83+
84+
**3.** Define the`DataModel`:
85+
86+
<snippet id='datagrid-aggregates-model'/>
87+
88+
**4.** Define the `ViewModel`:
89+
90+
<snippet id='datagrid-aggregates-viewmodel'/>
91+
92+
>important For the DataGrid `GroupHeaderAggregates Style` example refer to the [SDKBrowser Demo application]({%slug sdkbrowser-app%}) and navigate to the **DataGrid > Aggregates** category.
93+
94+
#### Example with the `GroupAggregateCellStyleSelector`
95+
96+
**1.** Define the DataGrid in XAML:
97+
98+
<snippet id='datagrid-group-header-aggregates'/>
99+
100+
**2.** Define the `StyleSelector` class:
101+
102+
<snippet id='datagrid-group-header-aggregate-nexttoheader-style-xaml'/>
103+
104+
**3.** Define the `GroupAggregateCellStyleSelector` in the page's resources:
105+
106+
<snippet id='datagrid-group-header-aggregate-nexttoheader-style-xaml'/>
107+
108+
**4.** Define the `DataModel`:
109+
110+
<snippet id='datagrid-aggregates-model'/>
111+
112+
**5.** Define the `ViewModel`:
113+
114+
<snippet id='datagrid-aggregates-viewmodel'/>
115+
116+
>important For the DataGrid `GroupHeaderAggregates StyleSelector` example refer to the [SDKBrowser Demo application]({%slug sdkbrowser-app%}) and navigate to the **DataGrid > Aggregates** category.
117+
53118
## Style the Group Footer
54119

55120
The DataGrid provides the following options for styling its group footer:

0 commit comments

Comments
 (0)