Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a list<hotel> ,which i'm binding to a listview, This list contain columns with values and null values. I'm doing sorting in both ascending and descending order. Descending no problem it works
C#
lstHotels.DataSource = lstHotelList.OrderByDescending(o => o.MinPrice).ToList();

in Ascending order
C#
lstHotels.DataSource = lstHotelList.OrderBy(o => o.MinPrice).ToList();

in this case the rows that have null values are appearing on the top,
What I want is I want to show records with smaller value on the top and put the records with null values at the end of listview

how to do?
ANy help wil be appreciated

Regards
Chinnu
Posted
Updated 6-Oct-12 20:30pm
v2

1 solution

I think you'll have to provide a cumstom sort logic to do that:
http://www.zagstudio.com/blog/441#.UHEhq5jMhnE[^]
 
Share this answer
 
Comments
ridoy 7-Oct-12 3:37am    
+5
Kenneth Haugland 7-Oct-12 3:49am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900