Click here to Skip to main content
15,910,083 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Glade I'm taking a couple days off .. Pin
kmoorevs1-Apr-15 9:21
kmoorevs1-Apr-15 9:21 
GeneralRe: Glade I'm taking a couple days off .. Pin
Pete O'Hanlon1-Apr-15 9:50
mvePete O'Hanlon1-Apr-15 9:50 
GeneralRe: Glade I'm taking a couple days off .. Pin
Mark_Wallace1-Apr-15 10:44
Mark_Wallace1-Apr-15 10:44 
GeneralRe: Glade I'm taking a couple days off .. Pin
Mark_Wallace1-Apr-15 11:07
Mark_Wallace1-Apr-15 11:07 
GeneralRe: Glad I'm taking a couple days off .. Pin
Richard MacCutchan1-Apr-15 21:31
mveRichard MacCutchan1-Apr-15 21:31 
GeneralWhere does it end? Pin
Sander Rossel1-Apr-15 8:03
professionalSander Rossel1-Apr-15 8:03 
GeneralRe: Where does it end? Pin
PIEBALDconsult1-Apr-15 8:42
mvePIEBALDconsult1-Apr-15 8:42 
GeneralRe: Where does it end? Pin
Sander Rossel1-Apr-15 8:59
professionalSander Rossel1-Apr-15 8:59 
I'm sorting the data that is then displayed by the grid. The DataGridView works pretty well when you have a DataView, but all I'm having is a List<T> which I haven't been able to sort in the past if my life depended on it. So it's easier to just take your original list, sort it (using OrderBy and OrderByDescending) and bind to the result. The same goes for filtering with Where.
PIEBALDconsult wrote:
Does your solution allow multi-level sorting?
Nope, should be a new value in the drop down, like "name then title".
PIEBALDconsult wrote:
I'm unclear on the details of what you have, but I would consider having each Item in the DropDown know what it is supposed to do -- perhaps a class with a Name and a Delegate -- so all you need do is add a new Item to the DropDown.
That's exactly what I have Laugh | :laugh:
The code I posted above could be called as follows:
C#
comboBoxOrdering.Items.Add(SomeFunction("Name", Queryable.OrderBy, q => q.Name));
I need all the generics so my IntelliSense (and compiler) knows that q is actually some type that has a Name property Smile | :)

And I'm having something similar for the filter functionality (which is also a dropdown).
C#
comboBoxFilters.Items.Add(SomeFunction("Active only", Queryable.Where, q => q.Active));
So even if you couldn't read the code above, I'm pretty sure you could use it Wink | ;)
Visit my blog at Sander's bits - Writing the code you need.
Or read my articles at my CodeProject profile.
Simplicity is prerequisite for reliability.
— Edsger W. Dijkstra
Regards,
Sander

GeneralRe: Where does it end? Pin
PIEBALDconsult1-Apr-15 9:20
mvePIEBALDconsult1-Apr-15 9:20 
GeneralRe: Where does it end? Pin
Sander Rossel1-Apr-15 9:31
professionalSander Rossel1-Apr-15 9:31 
GeneralRe: Where does it end? Pin
RASPeter6-Apr-15 11:39
professionalRASPeter6-Apr-15 11:39 
GeneralRe: Where does it end? Pin
Sander Rossel6-Apr-15 12:14
professionalSander Rossel6-Apr-15 12:14 
GeneralRe: Where does it end? Pin
Eddy Vluggen1-Apr-15 8:58
professionalEddy Vluggen1-Apr-15 8:58 
GeneralRe: Where does it end? Pin
Sander Rossel1-Apr-15 9:06
professionalSander Rossel1-Apr-15 9:06 
GeneralRe: Where does it end? Pin
Eddy Vluggen1-Apr-15 9:21
professionalEddy Vluggen1-Apr-15 9:21 
GeneralRe: Where does it end? Pin
Sander Rossel1-Apr-15 9:29
professionalSander Rossel1-Apr-15 9:29 
GeneralRe: Where does it end? Pin
Eddy Vluggen1-Apr-15 9:49
professionalEddy Vluggen1-Apr-15 9:49 
GeneralRe: Where does it end? Pin
Sander Rossel1-Apr-15 10:00
professionalSander Rossel1-Apr-15 10:00 
GeneralRe: Where does it end? Pin
Sascha Lefèvre1-Apr-15 8:59
professionalSascha Lefèvre1-Apr-15 8:59 
GeneralRe: Where does it end? Pin
Sander Rossel1-Apr-15 9:14
professionalSander Rossel1-Apr-15 9:14 
GeneralRe: Where does it end? Pin
Sascha Lefèvre1-Apr-15 9:36
professionalSascha Lefèvre1-Apr-15 9:36 
GeneralRe: Where does it end? Pin
Sander Rossel1-Apr-15 9:45
professionalSander Rossel1-Apr-15 9:45 
GeneralRe: Where does it end? Pin
Sander Rossel2-Apr-15 5:52
professionalSander Rossel2-Apr-15 5:52 
GeneralRe: Where does it end? Pin
Sascha Lefèvre2-Apr-15 7:54
professionalSascha Lefèvre2-Apr-15 7:54 
GeneralRe: Where does it end? Pin
Sander Rossel2-Apr-15 8:02
professionalSander Rossel2-Apr-15 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.