Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3160
Pivot grid does not sort
posted

Same problem as reported here:

http://blogs.infragistics.com/forums/t/65104.aspx

In the code below I put a breakpoint in the sortcoupon method and observed it is never executed (plus, the data in the grid is not sorted).  This was supposed to be fixed in 11.2.  Am I doing something wrong?

 

FilterHelper.FlatDataSource.HierarchyDescriptors.Where(x => x.HierarchyName == "Collateral")
 .Single().LevelDescriptors[1].OrderByKeyExpression = (Expression<Func<ExposureItem, string>>) (x => x.Collateral);

FilterHelper.FlatDataSource.HierarchyDescriptors.Where(x => x.HierarchyName == "Type")
 .Single().LevelDescriptors[1].OrderByKeyExpression = (Expression<Func<ExposureItem, string>>)(x => x.Type);

//FilterHelper.FlatDataSource.HierarchyDescriptors.Where(x => x.HierarchyName == "Coupon")
//    .Single().LevelDescriptors[1].OrderByKeyExpression = (Expression<Func<ExposureItem, decimal>>)(x => x.Coupon);


FilterHelper.FlatDataSource.HierarchyDescriptors.Where(x => x.HierarchyName == "Coupon")
 .Single().LevelDescriptors[1].OrderByKeyExpression = (Expression<Func<ExposureItem, decimal>>)(x => SortCoupon(x));

    
protected decimal SortCoupon(ExposureItem e)
{
 return e.Coupon;
}