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
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.
Valerie
Hi Valerie,
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,
Nick
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,
In the screenshot i attached on the first post you can see products Swap and Basis Swap, we would like to allow the user to define a format mask for Swap (e.g. 4 decimal places), but a different format mask (e.g. percentage) for Basis Swaps. What is the easiest approach to apply conditional formatting based on one of the properties of the databound object (in our case Product Type)?
You can use the CellControlAttached event to define conditional formats. Please see
http://help.infragistics.com/NetAdvantage/DV/2011.1/CLR4.0/?page=xamPivotGrid_US_Conditional_Formating.html
for more information.
Sincerely,
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thanks for your reply, regarding the sorting problem i am attaching a simple VS app that demonstrates how custom sort works correclty in 11.1 and does not in 11.2. When you run the app the Infragistics references are for 11.2 and the tenors appear in the order they are added to the collection. If you then change all the Infragistics references to 11.1 you will notice that the custom sort now works and the items are sorted correctly. Why is this not working in the same way for 11.2?
Regards,Nick
Hello Nick,
What is the version of 11.1 you have? The 11.1 RTM uses the custom sort by default and the order of items in the collection doesn’t matter. Since 11.1 SR1 we restored the earlier behavior where by default members appear in the order they are added to the collection.
Plamen.
Hello Doug,
If you have added sorting criteria to your HierarchyDescriptor and you have enabled row/ column sorting then when you click the sort indictor the columns /rows should be sorted based on the sort expression you have defined for the hierarchy. I tested this in 11.1 build 2053 and the columns / rows where sorted correctly after pressing the sort indicator.
Please let me know if you have any questions.
We are using version 11.1.20111.2053 and I would like to know whether the sorting works in this version or not. From what I see it doesnt but I need to make sure it isnt just my code is wrong.
We cannot easily upgrade to the next service release or indeed 11.2 as we get some problems after the upgrade that I havent had time to fix, so for the moment we need to stick to that release.
Thanks,Doug Rees
Ralph Lauren.
Thanks for the update. Looking forward to trying it out once it gets released.
There have been requests for this functionality, therefore we will be adding this back in the next service release for 11.1 and 11.2 with some changes.
The DataSourceBase.PreserveMembersOrder property will be changed to public with a default of true. Therefore you will need to set this property to false to use the OrderByKeyExpression.
Here are more details on the changes from engineering:
1. DataSourceBase.PreserveMembersOrder property is changed to be public with default value of true, that provides the same behavior we have with the current implementation.
2. This behavior can be overridden for specific levels as adding a LevelSortDirection instance to DataSourceBase.LevelDefaultSortDirections collection; that will change the initial appearance of these levels
<olap:FlatDataSource.LevelDefaultSortDirections> <olap:LevelSortDirection LevelUniqueName="[Date].[Date].[Years]" SortDirection="Descending"/> <olap:LevelSortDirection LevelUniqueName="[City].[City].[City]" SortDirection="Ascending"/> </olap:FlatDataSource.LevelDefaultSortDirections>
3. When DataSourceBase.PreserveMembersOrder is set to false, the initial direction depends on DataSourceBase.LevelFirstSortDirection value, unless the sort direction is specified using DataSourceBase.LevelDefaultSortDirections collection
This feature will be available for both flat data and XMLA.
Sincerely,ValerieDeveloper Support Engineer Infragisticswww.infragistics.com/support
Our datasource sort is getting more and more complicated as we want to sort more than one field at a time. The custom sort functionality in 11.1 used to work perfect for us and i am surprised that it was taken out. Is this a bug that will be resolved in future updates as we found the custom sort per field very useful.