Skip to content

Commit 7792e22

Browse files
add readme
1 parent edc11f9 commit 7792e22

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

Readme.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
3+
# Dashboard for WinForms - How to aggregate data by string concatenation
4+
5+
This example shows how to aggregate your data by string concatenation.
6+
7+
## Files to look at
8+
<!-- default file list -->
9+
* [Form1.cs](./CS/Dashboard_StringConcatAggregate/Form1.cs) (VB: [Form1.vb](./VB/Dashboard_StringConcatAggregate/Form1.vb))
10+
* [StringConcatFunction.cs](./CS/Dashboard_StringConcatAggregate/StringConcatFunction.cs) (VB: [StringConcatFunction.vb](./VB/Dashboard_StringConcatAggregate/StringConcatFunction.vb))
11+
<!-- default file list end -->
12+
13+
## Overview
14+
15+
In this example, the [Grid](https://docs.devexpress.com/Dashboard/15150/winforms-dashboard/winforms-designer/create-dashboards-in-the-winforms-designer/dashboard-item-settings/grid) dashboard item displays _СontactName_ values concatenated by country.
16+
17+
18+
The following expressions aggregates data by string concatenation for _СontactName_ values:
19+
20+
| Calculated Field | Expression |
21+
| --- | --- |
22+
| Contact names by countries | ``` StringConcat([ContactName]) ``` |
23+
24+
Call the [CriteriaOperator.RegisterCustomFunction](https://docs.devexpress.com/CoreLibraries/DevExpress.Data.Filtering.CriteriaOperator.RegisterCustomFunction(DevExpress.Data.Filtering.ICustomFunctionOperator)) method to register a custom function in your project. The following code snippet shows how to register the numeric group interval's function:
25+
26+
[Program.cs](./CS/Dashboard_StringConcatAggregatel/Program.cs):
27+
```csharp
28+
using System;
29+
using System.Windows.Forms
30+
using DevExpress.Data.Filtering;
31+
32+
namespace Dashboard_StringConcatAggregate {
33+
static class Program {
34+
/// <summary>
35+
/// The main entry point for the application.
36+
/// </summary>
37+
[STAThread]
38+
static void Main() {
39+
// ...
40+
CriteriaOperator.RegisterCustomFunction(new StringConcatFunction());
41+
Application.Run(new Form1());
42+
}
43+
}
44+
}
45+
```
46+
[Program.vb](./VB/Dashboard_StringConcatAggregate/Program.vb):
47+
```vb
48+
Imports System.Windows.Forms using DevExpress.Data.Filtering
49+
50+
Namespace Dashboard_StringConcatAggregate
51+
Friend Module Program
52+
''' <summary>
53+
''' The main entry point for the application.
54+
''' </summary>
55+
<STAThread>
56+
Sub Main()
57+
' ...
58+
CriteriaOperator.RegisterCustomFunction(New StringConcatFunction())
59+
Application.Run(New Form1())
60+
End Sub
61+
End Module
62+
End Namespace
63+
64+
```
65+
66+
## Documentation
67+
68+
- [Expression Constants, Operators, and Functions](https://docs.devexpress.com/Dashboard/400122/common-features/advanced-analytics/expression-constants-operators-and-functions)
69+
- [Grouping](https://docs.devexpress.com/Dashboard/116535/common-features/data-shaping/grouping)
70+
- [ICustomFunctionOperatorBrowsable](https://docs.devexpress.com/CoreLibraries/DevExpress.Data.Filtering.ICustomFunctionOperatorBrowsable)
71+
- [ICustomFunctionOperatorFormattable](https://docs.devexpress.com/CoreLibraries/DevExpress.Data.Filtering.ICustomFunctionOperatorFormattable)
72+
73+
## More Examples
74+
75+
- [Dashboard for WinForms - How to Calculate the Numeric Group Interval](https://github.com/DevExpress-Examples/winforms-dashboard-numeric-group-intervals)
76+
- [Dashboard for WinForms - How to Calculate Fiscal Functions from Date-Time Data Fields](https://github.com/DevExpress-Examples/How-to-calculate-fiscal-functions-for-date-time-data-fields)

0 commit comments

Comments
 (0)