c# - Keeping the item named 'other' at the bottom of my ordered list -



c# - Keeping the item named 'other' at the bottom of my ordered list -

i have list of selectlistitems this:

list<selectlistitem> test = new list<selectlistitem> { new selectlistitem { text="aaa", value ="1"}, new selectlistitem { text="ttt", value="2"}, new selectlistitem { text="bbb", value = "3"}, new selectlistitem { text="other", value = "4"} }.orderby(x => x.text).tolist();

this above code homecoming ordered list this:

aaa bbb other ttt

i order list maintain item named 'other' @ bottom of list.

how possible?

maybe work

list<selectlistitem> test = new list<selectlistitem> { new selectlistitem { text="aaa", value ="1"}, new selectlistitem { text="ttt", value="2"}, new selectlistitem { text="bbb", value = "3"}, new selectlistitem { text="other", value = "4"} }.orderby(x => x.text == "other").thenby(x => x.text).tolist();

c# asp.net asp.net-mvc

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

Hibernate criteria by a list of natural ids -

ios - Lagging ScrollView with UIWebview inside -