Thank you for your help!
If anybody has the same problem, here is my solution (perhaps it helps somebody):
I've created a "helper class" (attached file) that is handling the grouping (date grouping like outlook).
In the initialisation part of the form's code I've the following lines od code:
snip---snip---snip
this.ggc1.TableDescriptor.GroupedColumns.Changed += new Syncfusion.Collections.ListPropertyChangedEventHandler(GroupedColumns_Changed);
CustomizedGridGrouping("ColumnName");
snip---snip---snip
Then I've added the following parts:
snip---snip---snip
private void GroupedColumns_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e)
{
SortColumnDescriptor column = e.Item as SortColumnDescriptor;
if (e.Action == Syncfusion.Collections.ListPropertyChangedType.Insert)
{
if (column.Name == "ColumnName")
{
CustomizedGridGrouping("ColumnName");
}
}
}
private void CustomizedGridGrouping(string column)
{
Syncfusion.Grouping.SortColumnDescriptor cd = new Syncfusion.Grouping.SortColumnDescriptor(column, ListSortDirection.Descending);
cd.Categorizer = new GridGroupingHelper.GridGroupingHelper_Categorizer();
//cd.Comparer = new GridGroupingHelper.GridGroupingHelper_Comparer();
if (this.ggc1.TableDescriptor.GroupedColumns.Contains(column))
this.ggc1.TableDescriptor.GroupedColumns.Remove(column);
this.ggc1.TableDescriptor.GroupedColumns.Add(cd);
this.ggc1.QueryCellStyleInfo += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventHandler(CustomizedGridGrouping_Format);
}
private void CustomizedGridGrouping_Format(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.GroupedColumn != null && e.TableCellIdentity.DisplayElement.ParentGroup != null
&& e.TableCellIdentity.DisplayElement.ParentGroup.Category is int
)
{
if (e.TableCellIdentity.DisplayElement is CaptionRow
&& e.TableCellIdentity.GroupedColumn.Name == "ColumnName")
{
e.Style.CellValue = String.Format("{0}: {1} {2}", (string)GridGroupingHelper.GridGroupingHelper_Format.ColumnLabelByDateGroup((int)e.TableCellIdentity.DisplayElement.ParentGroup.Category), e.TableCellIdentity.DisplayElement.ParentGroup.GetChildCount(), "YourText");
}
if (this.ggc1.Table.Records.Count > 0)
this.ggc1.Table.Records[0].ParentGroup.IsExpanded = true;
}
}
snip---snip---snip
Hope this helps anybody.
GridGroupingHelper.zip