How sort a System.Collections.Generic.List in VB.Net?

前端 未结 4 1273
悲&欢浪女
悲&欢浪女 2021-01-31 09:23

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_         


        
4条回答
  •  遇见更好的自我
    2021-01-31 09:27

    Try this

    Dim m_equipmentList As New List(Of Schedule_Payitem)
    
    
    m_equipmentList.Sort(delegate(Schedule_Payitem p1, Schedule_Payitem p2)
                  {
                      return p1.resourceid .CompareTo(p2.resourceid );
                  });
    

提交回复
热议问题