Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
Questionpopups from webbrowser control Pin
Opa Knack6-Sep-07 9:54
Opa Knack6-Sep-07 9:54 
AnswerRe: popups from webbrowser control Pin
Spacix One6-Sep-07 10:47
Spacix One6-Sep-07 10:47 
QuestionComparing an Image Pin
Gareth H6-Sep-07 8:38
Gareth H6-Sep-07 8:38 
AnswerRe: Comparing an Image Pin
Rick van Woudenberg6-Sep-07 8:57
Rick van Woudenberg6-Sep-07 8:57 
AnswerRe: Comparing an Image Pin
Luc Pattyn6-Sep-07 9:03
sitebuilderLuc Pattyn6-Sep-07 9:03 
AnswerRe: Comparing an Image Pin
Judah Gabriel Himango6-Sep-07 9:05
sponsorJudah Gabriel Himango6-Sep-07 9:05 
QuestionSorting Multiple Properties Pin
DaveyM696-Sep-07 7:45
professionalDaveyM696-Sep-07 7:45 
AnswerRe: Sorting Multiple Properties [modified] Pin
Luc Pattyn6-Sep-07 7:51
sitebuilderLuc Pattyn6-Sep-07 7:51 
Hi,

you need a CompareTo method that compares the first sorting property first;
if the result is zero (which means the first property is indecisive), compare the second,
etc. until you have a decision on the relative sort order.

So it could look like this:
int diff=People1.Firstname-People2.Firstname;
if (diff==0) diff=People1.Surname-People2.Surname;
if (diff==0) diff=....;
return diff;


[CORRECTION] the - operator is not appropriate for string compare;
use diff=string.Compare(People1.SomeProperty, People2.SomeProperty); instead;
remark: Compare() has overloads to control case sensitivity [/CORRECTION]

Smile | :)


-- modified at 14:39 Thursday 6th September, 2007

Luc Pattyn [Forum Guidelines] [My Articles]


this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google


GeneralRe: Sorting Multiple Properties Pin
DaveyM696-Sep-07 8:05
professionalDaveyM696-Sep-07 8:05 
GeneralRe: Sorting Multiple Properties Pin
TJoe6-Sep-07 8:16
TJoe6-Sep-07 8:16 
GeneralRe: Sorting Multiple Properties Pin
Luc Pattyn6-Sep-07 8:17
sitebuilderLuc Pattyn6-Sep-07 8:17 
GeneralRe: Sorting Multiple Properties Pin
DaveyM696-Sep-07 8:25
professionalDaveyM696-Sep-07 8:25 
GeneralRe: Sorting Multiple Properties Pin
Luc Pattyn6-Sep-07 8:32
sitebuilderLuc Pattyn6-Sep-07 8:32 
Questionclasses.. Pin
rcwoods6-Sep-07 6:50
rcwoods6-Sep-07 6:50 
AnswerRe: classes.. Pin
Colin Angus Mackay6-Sep-07 6:58
Colin Angus Mackay6-Sep-07 6:58 
GeneralRe: classes.. [modified] Pin
Jason Hanford-Smith6-Sep-07 7:21
Jason Hanford-Smith6-Sep-07 7:21 
GeneralRe: classes.. Pin
Colin Angus Mackay6-Sep-07 9:34
Colin Angus Mackay6-Sep-07 9:34 
GeneralRe: classes.. Pin
Jason Hanford-Smith6-Sep-07 9:37
Jason Hanford-Smith6-Sep-07 9:37 
GeneralRe: classes.. Pin
Larantz6-Sep-07 10:03
Larantz6-Sep-07 10:03 
GeneralRe: classes.. Pin
Colin Angus Mackay6-Sep-07 10:18
Colin Angus Mackay6-Sep-07 10:18 
GeneralRe: classes.. Pin
Larantz6-Sep-07 10:21
Larantz6-Sep-07 10:21 
GeneralRe: classes.. Pin
Colin Angus Mackay6-Sep-07 11:12
Colin Angus Mackay6-Sep-07 11:12 
GeneralRe: classes.. Pin
Colin Angus Mackay6-Sep-07 13:33
Colin Angus Mackay6-Sep-07 13:33 
GeneralRe: classes.. Pin
martin_hughes6-Sep-07 7:47
martin_hughes6-Sep-07 7:47 
GeneralRe: classes.. Pin
Luc Pattyn6-Sep-07 7:55
sitebuilderLuc Pattyn6-Sep-07 7:55 

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.