views:

2347

answers:

1

Ok, so I have an nHibernate ICriteria that returns an object. I want to order by a single property but NOT asc or desc I want certain values of the property to come to the top of the repeater based on the selection. Like if I choose "video" I want all records with videos to come to the top.

Now, can I do this in the query? or the repeater? ICriteria?

Thanks for your help.

+3  A: 

Well...if you can't figure out how to do it with NHibernate, you could always use linq-to-objects, then bind your repeater to that:

var bubbleVideos = from item in criteriaList
                   orderby (item.ItemType == "video" ? 0 : 1)
                   select item;
repeater.DataSource = bubbleVideos.ToList();
Brendan Kowitz
looks awesome, gonna try it.
Sara Chipps