Hi,
1) We would like to be able to sort on tennors (eg. 5 years, 3 months, 10 days). The data comes in as (2Y, 1Y,6M, 3M, 1M, 10d, 5d, 1d etc) Is it possible to apply a custom sort. I have attached an example screenshot with year tennors as they appear. In the example below we would like it to be (60Y, 50Y, 40Y, 30Y .....etc).
2) Additionaly we would like to enable to user to reposition the Currency columns or product rows similar to the Field Chooser drag drop indexing in the XamDataGrid. How would we go about providing such functionality.
3) Finally we would like to display "N/A" for measures that are aggregated. In our case we don't want to show data if it is aggregated. Therefore we only want to show data when the user has drilled down to a result count of 1. I can see that we can specify an aggregation calculation to be Count and can see which cells are made up of more than one value, however how can we display the value only when it is not an aggregate, otherwise "N / A". Many Thanks
Hi Valerie,
We have updated to 11.2 and the tenor row sorting no longer works.
Here is my code, NOTE that i am using DynamicTypeBuilder to create my object and this way of adding and sorting the tenor hierarche worked in 11.1, however something must have changed in 11.2 and now no sort is applied. Could it be to do with the way i create a HierarcheDiscriptor for a DynamicType object:
Expression<Func<object, DateTime>> tenorExpression = dynamicMarketDataResult => TennorHelper.EvaluateTenorSort( dynamicMarketDataResult.GetType().GetProperty("TENOR").GetValue( dynamicMarketDataResult, null).ToString()); var hierarchy = new HierarchyDescriptor { SourcePropertyName = "TENOR" }; var level = new HierarchyLevelDescriptor { LevelName = "TENOR", LevelExpressionPath = "TENOR" }; hierarchy.LevelDescriptors.Add(level); hierarchy.LevelDescriptors[0].OrderByKeyExpression = tenorExpression;
....
Here is my sort expression which works correctly.
public static DateTime EvaluateTenorSort(string tenor) { var date = DateTime.MinValue; if (tenor == null) return date; int tenorNum; if (tenor.ToUpper().Contains("D")) { int.TryParse(tenor.Substring(0, tenor.ToUpper().IndexOf('D')), out tenorNum); return date.AddDays(tenorNum); } if (tenor.ToUpper().Contains("W")) { int.TryParse(tenor.Substring(0, tenor.ToUpper().IndexOf('W')), out tenorNum); return date.AddDays(tenorNum*7); } if (tenor.ToUpper().Contains("M")) { int.TryParse(tenor.Substring(0, tenor.ToUpper().IndexOf('M')), out tenorNum); return date.AddMonths(tenorNum); } if (tenor.ToUpper().Contains("Y")) { int.TryParse(tenor.Substring(0, tenor.ToUpper().IndexOf('Y')), out tenorNum); return date.AddYears(tenorNum); } return date; }
Has something changed in 11.2 with regard to sorting as this all worked in 11.1 and the row sorting is key functionality for us.
Thanks,
Nick
Hello Nick,
The following link shows how to expand the hierarchies:
http://help.infragistics.com/Help/NetAdvantage/WPFDV/2011.1/CLR4.0/html/xamPivotGrid_US_Expanding_Hierarchies_In_Runtime_From_Code.html
Sincerely,
Valerie
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thanks for the reply, adding a hierarchy and sort expression did the job.
I will get back to you regarding request 2, we are currently evaluating if it is a necessity for the users.
Regarding point 3, we are using the pivot grid to display market data therefore total rows/columns and aggregations do not make sense. I have found a way to remove the total rows and columns but was wondering if there was a simple way to always have the pivot grid in fully expanded mode.
Secondly our scenario is as follows:
Regards,
Hello,
The following help topic explains how to implement custom sorting in the XamPivotGrid:
http://help.infragistics.com/Help/NetAdvantage/WPFDV/2011.1/CLR4.0/html/xamPivotGrid_DV_Sorting_Rows_and_Columns.html
Please let me know more about your request 2. I believe custom ordering the columns would be a feature request. Please give me precise information on how you would like this to work for your users.
Finally for request three, I am unsure what functionality you are looking for since the Pivot Grid is designed to show aggregated values which can then be drilled into. In your case it would sound as if you would want the Grid fully expanded so that all the values are displayed.