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
1220
problems with serverside grid sorting when binding to custom collection
posted

Hello,

When i try to sort my grid on a custom (date) property, i get a weird behavior where it doesn't quite sort the dates. It appears to break the sort into 2 parts. top to middle is sorted, and than from middle to bottom is a separate sort. i.e. april 1 - may 7th.. than from middle it appears to start again april 9th - may13th etc.. 

It may be because i am binding the grid to List<MyPosition>, and MyPosition date member is not actually a DateTime type. it is an Object. I have it that way because i use shared base type functionality. I overwrote all the necessary interfaces so that it is treated like a DateTime by the rest of the framework, but Infragistics grid seems to be tripping on it. My Grid is version 8.2

 

here is my base type implementation (the object i use instead of DateTime):

http://paste.bradleygill.com/index.php?paste_id=9282

I use that base type to serve as base to all date parameters such as: 

public class TradeDate : QueryDateTimeParameter {...}
public class SettlementDate : QueryDateTimeParameter {...} 
etc.. 

and than, I have a Position object:

public class PortfolioPosition {
  public TradeDate Date { get; set; }
  public InterestParameter Interest {get; set;}
  etc...
}

than i use a List<PortfolioPosition> which is the collection bound to the grid.  

My sorting code:

  PositionsGrid.Bands[0].SortedColumns.Add( myColumn );
  myColumn.SortIndicator = SortIndicator.Ascending;

 

That columns DataType property is set to DateTime, but grid doesn't seem to care about it. I am wondering how does it know what kind of sort to perform (alphabetic, numeric, date.. etc)