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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:41:54+00:00 2026-05-26T08:41:54+00:00

I ve a list which is filled by me and sorted! I wanna add

  • 0

I ve a list which is filled by me and sorted! I wanna add some new items to that sorted list but these new items should be at the top of the list.

I’m adding items to list:

var OnlySup = dataContext.GroupDetails.Where(c => c.sup_id == c.suppliers.supplier_id).Select(c=>c.sup_id).Distinct().ToList();

/* GET SUPPLIERS FROM DB */
foreach (var supp in OnlySup)
{
    /* ADD EACH SUPPLIER TO LIST */
    SupplierList.Add(new SelectListItem() { Text = supp.supplier, Value = "S" + supp.supplier_id.ToString() });
}

Sorting:

/* ReOrder The List */
SupplierList = SupplierList.OrderBy(c => c.Text).ToList();

List items that i wanna add to the top of the list:

/* DEFAULT ADD */
SupplierList.Add(new SelectListItem() { Text = "ALL Groups", Value = "G" });
SupplierList.Add(new SelectListItem() { Text = "ALL Suppliers", Value = "S" });
SupplierList.Add(new SelectListItem() { Text = "ALL Suppliers AND Groups", Value = "%" });

/* GET GROUPS FROM DB */
var OnlyGroup = dataContext.groups.OrderBy(c => c.id).Distinct().ToList();

/* FOR EACH GROUP */
foreach (var groups in OnlyGroup)
{
    /* ADD EACH GROUP TO LIST */
    SupplierList.Add(new SelectListItem() { Text = groups.group_name, Value = "G" + groups.id.ToString() });
}

So how can i achive this?

  • 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-26T08:41:55+00:00Added an answer on May 26, 2026 at 8:41 am

    why don’t you invoke the Insert method ?

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

Sidebar

Related Questions

I have a list which is dynamically built, but there are empty list items
I have a list of items, which i'd like to check with filled star
I have a list that gets filled in with some data from an operation
I have a nested list which must be filled with new data based on
I've a list which is List < TempVO> lstTemp = new ArrayList < TempVO>
I have a list which has repeating items and I want a list of
My project is .NET/WinForms. I have a list view which is always filled with
I have a list which is filled with a custom ArrayAdapter . I want
I have a checkbox list which is filled with entries from my database on
I'm fairly new to Silverlight. I have an AutoCompleteBox which is filled with Data

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.