Eamon
asked on
Sort object using parameter for property name
This seems to work it sorts my list of ProjectActions by DueDate
actionList.Sort(delegate(P rojectActi on al1, ProjectAction al2) { return al1.DueDate.CompareTo(al2. DueDate); });
I would like to pass in the property to sort by as a parameter
string SortBy = "DueDate"
something like this.
al1(SortBy).compareto al2(SortBy)
Is it possible to do this
actionList.Sort(delegate(P
I would like to pass in the property to sort by as a parameter
string SortBy = "DueDate"
something like this.
al1(SortBy).compareto al2(SortBy)
Is it possible to do this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
you can also sort by multiple properties, for instance:
Open in new window