c# - Order a list with unique rows with a given row as first item, then reorder the list but without the first row -



c# - Order a list with unique rows with a given row as first item, then reorder the list but without the first row -

let's have list records in ("germany", "belgium", "netherlands", "spain", "russia", "italy").

and want order list "belgium" on top of list.

so when load list combobox "belgium" selectedvalue load.

now how order rest of list?

this have: "belgium" comes @ top rest not ordered.

homecoming enumerable.select(gettable() .orderbydescending(o => o.name == country) .thenby(o => o.name != country), b => new comboboxbase.comboboxliststructguid { id = b.countryid, description = b.country }).tolist();

return enumerable.select(gettable() .orderbydescending(o => o.name == country) .thenby(o => o.name), b => new comboboxbase.comboboxliststructguid { id = b.countryid, description = b.country }).tolist();

c# linq

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -