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
1934
SortComparer does not work after DisplayLayout.LoadFromXML
posted

 OK, so I fire up the grid and bind to my DataTable and I then load a layout from a file.  I know the XML files don't save the SortComparers of the columns so after calling LoadFromXML I set all custom SortComparers again.  It doesn't work though.  I'm trying to sort equities by rating AAA, A+, AA, A+, A-, A, etc.  But even with my SortComparer set after the load I just get A, A-, A+, etc.  It works perfectly fine if I use the SortComparer in the InitializeLayout event, any ideas?

Parents
No Data
Reply
  • 1934
    posted

     I should also mention that I debugged line by line and it does indeed go into the SortComparer CompareTo method and nothing else after that.  But once I click the column header to sort again and get inside the BeforeSortChange event then the SortComparer of my column is null.  Like I said, I am not executing any code between those two points and nowhere in my code do I ever set the SortComparer = null.

Children
No Data