Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 110537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:14:33+00:00 2026-05-11T02:14:33+00:00

I using a genric list(m_equipmentList ) which is collection of objects (Schedule_Payitem). How can

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:14:34+00:00Added an answer on May 11, 2026 at 2:14 am

    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 implement IComparer(Of Schedule_PayItem). pass whichever one you’ve got into List.Sort.

    An example for the lambda expression (untested):

    m_equipmentList.Sort(Function(p1, p2) p1.ResourceID.CompareTo(p2.ResourceID)) 

    And for the IComparer(Of Schedule_PayItem):

    Public Class PayItemResourceComparer     Implements IComparer(Of Schedule_PayItem)     Public Function Compare(ByVal p1 As Schedule_PayItem, _                             ByVal p2 As Schedule_PayItem) As Integer         Return p1.ResourceID.CompareTo(p2.ResourceID)     End Function End Class  ...  m_equipmentList.Sort(New PayItemResourceComparer) 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to sort data which is from Generic List object. By using
I'm using this code: Dim cListItems As New System.Collections.Generic.List(Of Combobox_values) cListItems.Add(New Combobox_values(One, 1)) cListItems.Add(New
How can I sort generic list DESC and ASC? With LINQ and without LINQ?
I have a generic list that I'm removing items out of using List.Remove(Object) .
I'm using a Windows Forms DataGridView to display a generic list of MyObject objects.
I'm using XmlSerializer to serialize an object that contains a generic list List <ChildBase>
I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List<T>
To be able to sort a dictionary by value I'm using this code: Dim
good stuff // ok to alias a List Type using AliasStringList = System.Collections.Generic.List<string>; //
I'm using django.views.generic.list_detail.object_detail. According to the documentation the view takes the variable object_id. To

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.