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 6368673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:42:20+00:00 2026-05-25T00:42:20+00:00

I have a list that I would like to sort in multiple ways. My

  • 0

I have a list that I would like to sort in multiple ways.

My List is made using this:

theMainList.Add(new LoadLine(theChipList[count].Name, theChipList[count].PartNumber, 
                theChipList[count].XPlacement, theChipList[count].YPlacement, 
                theChipList[count].Rotation, theChipList[count].PkgStyle, 
                theChipList[count].PackageType, theChipList[count].PartDescription,
                theChipList[count].Feeder, theChipList[count].Vision,
                theChipList[count].Speed, theChipList[count].Machine,
                theChipList[count].TapeWidth, theChipList[count].PlacingTime));

I start off by getting each line using foreach(var line in theMainList).

Now, for each line I need to compare certain positions and sort them accordingly.

So, FIRST what I would like to compare is each line.Speed and organize the list numerically (so if the speeds were 1,2,3,4,5, etc the first line in the list would be the line that has the line.Speed equal to 1, and then 2, etc.)

SECOND I would like to sort the updated list that is now in order of line.Speed again. I would like to sort the line.PackageStyle in the order of this:

"FIDUCIAL", "FID", "FID0", "FID1", "FID2", "FID3", "FID4", "FID5",
"FID6", "FID7", "FID8", "FID9", "RES", "0402", "0201", "0603", 
"0805","1206", "1306", "1608", "3216", "2551", "1913", "1313",
"2513","5125", "2525", "5619", "3813", "1508", "6431", "2512",
"1505","2208", "1005", "1010", "2010", "0505", "0705", "1020",
"1812","2225", "5764", "4532", "1210", "0816", "0363", "SOT"

THIRD I would like to sort the new updated list with the Speed sorted first, and then thee PackageStyle sorted secondly…by the line.PartNumber. Again this would be numerically just like the line.Speed was.

Is there any way to do this mulitple sorting technique?

  • 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. Editorial Team
    Editorial Team
    2026-05-25T00:42:21+00:00Added an answer on May 25, 2026 at 12:42 am

    Use Linq’s OrderBy() and ThenBy() methods:

    theMainList.OrderBy(l => l.Speed)
               .ThenBy(l => l.PackageStyle)
               .ThenBy(l => l.PartNumber);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following DOM structure (unordered list), that I would like to sort
Let's say I have a list of domain names that I would like to
I would like to have a function that modifies some variable list of parameters
I have a list of numbers which total 540000. I would like to sort
I would like to ask something about query using mysql I have this table
I would like to add an element to a list that preserve the order
I have a handful of records that I would like to sort based on
If I have a list that contains a list that looks like this ['a',1]
I have a list of files I would like to sort based on the
Using MySQL, i'm selecting a list of songs in spanish that i would like

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.