I would like to be able to change format for a date in pivot table, Can I do it by binding? How can i do it dynamically?
Hi Patrycja,
We are a little unclear about your reported issue. Please provide more
information related to your query?
Kindly revert to us with the above
requested details. It will be more helpful for us to check the possibilities to
resolve the reported problem.
Regards,
Vijayarasan S
My scenario: I chose daily interval, meaning that I would like to be able to see date in format "dd.MM.yyyy HH.mm.ss", but when I change Interval to Monthly I would like to be able to see the table in format "mm.yyyy" .
How can set it dynaically?
Hi Patrycja,
We regret to inform you that format property does not contain support to bind
the format value in PivotGrid.
However, your requirement to change the format at run time can be achieved by define
the format like below mentioned code snippet,
|
private void ChangeMonthlyFormat(object sender, RoutedEventArgs e) { //change the date format at run time in PivotGrid var getIndexOfDataColumn = this.pivotGrid1.InternalGrid.GetColumnIndexFromName("Date"); this.pivotGrid1.PivotRows[getIndexOfDataColumn].Format = "mm.yyyy"; this.pivotGrid1.Refresh(); }
private void ChangeDailyFormat(object sender, RoutedEventArgs e) { //change the date format at run time in PivotGrid var getIndexOfDataColumn = this.pivotGrid1.InternalGrid.GetColumnIndexFromName("Date"); this.pivotGrid1.PivotRows[getIndexOfDataColumn].Format = "dd.MM.yyyy HH.mm.ss"; this.pivotGrid1.Refresh(); } |
Please find the sample in the attachment and let us know if you have any
concerns in this.
Regards,
Vijayarasan S
Thanks for response!
Hi Patrycja,
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Vijayarasan S