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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:16:21+00:00 2026-06-11T01:16:21+00:00

I am currently using the following code to sort a dictionary: Dictionary<string, TKosStock> NewList

  • 0

I am currently using the following code to sort a dictionary:

Dictionary<string, TKosStock> NewList = null;
if (SortBy.CompareTo(TSortOptions.sortASC | TSortOptions.sortPRICE) == 0)
   NewList = new Dictionary<string, StockObj>(this.StockItemList.OrderBy(n => n.Value.SellPriceRangeLowGross).ToDictionary(n => n.Key, n => n.Value));

this.StockItemList = new Dictionary<string, TKosStock>(NewList.ToDictionary(n => n.Key, n => n.Value));

This works well and re-shuffles my list correctly. I can then loop through this.StockItemList knowing my values are in the correct order.

What I would like to do is add the items in the correct order in the first place. I can’t do this based on the SQL query because the prices aren’t calculated when the SQL query initially runs.

p.s I assume the overhead for this re-shuffle is low but if it can be done when initially adding the items then I assume the overhead would be even lower.

Is this possible?

  • 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-06-11T01:16:23+00:00Added an answer on June 11, 2026 at 1:16 am

    Perhaps using an ordered dictionary (non-generic):

    http://msdn.microsoft.com/en-us/library/system.collections.specialized.ordereddictionary.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using the following code (C#): private static void PlayLoop(string filename) { Audio
I am currently using the following code to update form data before submission. $('.countyx').change(function(){
I'm currently using the following code to append a X link to each element
Hey I am currently using the following code Dim flickr As New Flickr(apikey) Dim
I'm currently using StructureMap to inject instances of NHibernate ISessions using the following code:
I'm currently using the following PHP code: // Get all subordinates $subords = array();
Currently I'm using the following code to append certain elements to the DOM: $('<p/>',
I am using currently the following code to populate a combobox: combobox.DataSource = datatable;
In short, currently I am using the following code to pull records from multiple
I'm currently facing new problem with operators. Using following code, I want to make

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.