Skip to main content

Problem with Custom Sorting

Comments

3 comments

  • Dapfor Team

    Hello,

    We think that the problem is in the comparing method. You should return 0 if t1 == t2. Try to change the code and let us know if the problem is solved.

    Best regards,

    Dapfor

     

     

    0
  • Michael Sage

    That didn't seem to help, I'm still getting the same error. This is the code I'm using 

     

    if (fieldId == "Time")
    {
    DateTime t1 = ((TickerModel)row1.DataObject).LastSaleTime;
    DateTime t2 = ((TickerModel)row2.DataObject).LastSaleTime;

    if (t1 != null && t2 != null)
    {
    if (t1.Equals(t2))
    return 0;
    else
    return t1.CompareTo(t2);
    }
    }

    0
  • Dapfor Team
    Could you attach a small demo project demonstrating the problem? Which version of the grid do you use? Regards, Dapfor
    0

Please sign in to leave a comment.

Powered by Zendesk