locked
Is sorting a ListView on an EntityRef column possible? RRS feed

  • Question

  • User1351927256 posted

    I have a ListView that displays the typical info from a table, including a column that is a reference to a parent entity.  I have created a custom property on the parent entity class that is simply a combination of FirstName and LastName as a string, and I set the DisplayColumnAttribute for the parent entity to this new property.  This allows me to display the parent entity as the first name and last name in my list.  The problem is that when I try to sort the column the list can't sort on the parent entity.  Is there a way to make the ListView be able to sort a column based on an EnityRef type?  Or perhaps on a property of that entity?

    Thursday, August 28, 2008 1:31 PM

Answers

  • User-797310475 posted

    If the parent's display column is a custom column then you cannot sort by it. That is because the column is defined on the client (ie your web server that is hosting your site) while the sorting is done on the server (ie sql server).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 28, 2008 4:06 PM

All replies

  • User-797310475 posted

    If the parent's display column is a custom column then you cannot sort by it. That is because the column is defined on the client (ie your web server that is hosting your site) while the sorting is done on the server (ie sql server).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 28, 2008 4:06 PM
  • User1351927256 posted

    Thanks for the explanation.  That makes sense.  Until I figure something better out, I'm just removing sorting for the EntityRef columns.  Down the road I may try doing some custom sorting for those columns, but for now this will have to suffice. 

    Tuesday, September 2, 2008 1:33 PM