Hi Hristo,
Thanks a lot for your answer, your code soved the problem.
I've understood my mistake and modified my code because I prefere to directly check the type than convert to string and then try to parse it.
This seems to work fine too :
private void rpvtGrid_GroupElementFormatting(object sender, PivotGroupElementEventArgs e) {
object groupValue = null;
switch (e.GroupElement.Data.Group.Type) {
case GroupType.Subtotal:
groupValue = e.GroupElement.Data.Group.Parent?.Name;
break;
case GroupType.Subheading:
case GroupType.BottomLevel:
groupValue = e.GroupElement.Data.Group.Name;
break;
}
if (groupValue != null && groupValue is DateTime) {
DateTime groupDate = (DateTime)groupValue;
e.GroupElement.Text = groupDate.ToString("dd/MM/yy") + (e.GroupElement.Data.Group.Type == GroupType.Subtotal ? " Total" : String.Empty);
}
}