Click here to Skip to main content
15,886,634 members
Home / Discussions / C#
   

C#

 
AnswerRe: Open drop down list Pin
Jimmanuel26-Mar-09 9:22
Jimmanuel26-Mar-09 9:22 
GeneralRe: Open drop down list Pin
Chazzysb26-Mar-09 10:09
Chazzysb26-Mar-09 10:09 
QuestionCasting socket data to a type Pin
FoxholeWilly26-Mar-09 8:26
FoxholeWilly26-Mar-09 8:26 
AnswerRe: Casting socket data to a type Pin
Eddy Vluggen26-Mar-09 9:26
professionalEddy Vluggen26-Mar-09 9:26 
QuestionListBox Sorting issue (inaccurate) Pin
dfb7826-Mar-09 8:10
dfb7826-Mar-09 8:10 
AnswerRe: ListBox Sorting issue (inaccurate) Pin
Yusuf26-Mar-09 8:54
Yusuf26-Mar-09 8:54 
GeneralRe: ListBox Sorting issue (inaccurate) Pin
dfb7826-Mar-09 9:41
dfb7826-Mar-09 9:41 
AnswerRe: ListBox Sorting issue (inaccurate) Pin
Luc Pattyn26-Mar-09 8:55
sitebuilderLuc Pattyn26-Mar-09 8:55 
Hi,

I have several remarks:

1.
if it contains ListViewItems, I guess your Control is a ListView, not a ListBox.

2.
you did not show code for ObjectCompare, which does the actual compare.

3.
all we can see is ObjectCompare takes two strings; if all it does is compare the strings, then the right order is 10, 11, 2 since strings by default get sorted alphabetically based on their individual characters, taken from left to right, hence 11 comes before 2 since '1'<'2'

4.
if OrderOfSort happens to be SortOrder.Unspecified then any result would be correct.

5.
I don't know how you populate your ListView; if you have objects that hold numeric values (such as Id, Score and TotalValue) then it does not make much sense to convert them to string (so you can show them in the ListView) and then try and convert that string back to integers so you can perform a correct compare. You could use the ListViewItem.Tag to hold a reference to your object, and then perform the necessary comparison directly using the integer values.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


Questioncalculator Pin
the exile26-Mar-09 8:04
the exile26-Mar-09 8:04 
AnswerRe: calculator Pin
Eddy Vluggen26-Mar-09 8:08
professionalEddy Vluggen26-Mar-09 8:08 
GeneralRe: calculator Pin
the exile26-Mar-09 8:20
the exile26-Mar-09 8:20 
GeneralRe: calculator Pin
EliottA26-Mar-09 8:48
EliottA26-Mar-09 8:48 
QuestionRe: calculator Pin
CPallini26-Mar-09 8:09
mveCPallini26-Mar-09 8:09 
JokeRe: calculator Pin
Yusuf26-Mar-09 8:50
Yusuf26-Mar-09 8:50 
JokeRe: calculator Pin
CPallini26-Mar-09 9:04
mveCPallini26-Mar-09 9:04 
JokeRe: calculator Pin
0x3c026-Mar-09 9:35
0x3c026-Mar-09 9:35 
AnswerRe: calculator Pin
Roger Wright26-Mar-09 20:04
professionalRoger Wright26-Mar-09 20:04 
AnswerRe: calculator [modified] Pin
Alan Balkany27-Mar-09 3:59
Alan Balkany27-Mar-09 3:59 
Questionhow to use a list array to populate a listbox with columns Pin
robertkjr3d26-Mar-09 7:31
robertkjr3d26-Mar-09 7:31 
AnswerRe: how to use a list array to populate a listbox with columns Pin
dan!sh 26-Mar-09 7:44
professional dan!sh 26-Mar-09 7:44 
GeneralRe: how to use a list array to populate a listbox with columns Pin
robertkjr3d26-Mar-09 7:57
robertkjr3d26-Mar-09 7:57 
GeneralRe: how to use a list array to populate a listbox with columns Pin
dan!sh 26-Mar-09 8:15
professional dan!sh 26-Mar-09 8:15 
GeneralRe: how to use a list array to populate a listbox with columns Pin
robertkjr3d26-Mar-09 8:25
robertkjr3d26-Mar-09 8:25 
GeneralRe: how to use a list array to populate a listbox with columns Pin
Fayu26-Mar-09 8:39
Fayu26-Mar-09 8:39 
GeneralRe: how to use a list array to populate a listbox with columns Pin
dan!sh 26-Mar-09 8:48
professional dan!sh 26-Mar-09 8:48 

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.