I using a genric list(m_equipmentList ) which is collection of objects (Schedule_Payitem).
How can sort list according to a proerty of child object ?
Dim m_equipmentList As New List(Of Schedule_Payitem)
Need to sort m_equipmentList on basis of resourceid property of Schedule_Payitem.
Are you using VB9? If so, I’d use a lambda expression to create a
Comparer(Of Schedule_PayItem). Otherwise, write a short class to implementIComparer(Of Schedule_PayItem). pass whichever one you’ve got into List.Sort.An example for the lambda expression (untested):
And for the
IComparer(Of Schedule_PayItem):