Click here to Skip to main content
15,890,897 members
Home / Discussions / C#
   

C#

 
AnswerRe: Issue related to DatagridviewButton . Pin
NanaAM11-Sep-08 1:27
NanaAM11-Sep-08 1:27 
GeneralRe: Issue related to DatagridviewButton . Pin
supriyaP11-Sep-08 19:20
supriyaP11-Sep-08 19:20 
QuestionBackgrounImage refresh problem Pin
mihksoft11-Sep-08 1:04
mihksoft11-Sep-08 1:04 
AnswerRe: BackgrounImage refresh problem Pin
Harvey Saayman11-Sep-08 1:38
Harvey Saayman11-Sep-08 1:38 
QuestionHelp incase of Sorting with .net Framework Pin
tasumisra11-Sep-08 0:35
tasumisra11-Sep-08 0:35 
AnswerRe: Help incase of Sorting with .net Framework Pin
DaveyM6911-Sep-08 0:43
professionalDaveyM6911-Sep-08 0:43 
GeneralRe: Help incase of Sorting with .net Framework Pin
tasumisra11-Sep-08 0:55
tasumisra11-Sep-08 0:55 
GeneralRe: Help incase of Sorting with .net Framework Pin
DaveyM6911-Sep-08 1:18
professionalDaveyM6911-Sep-08 1:18 
If you're wanting to be able to use SortOrder then something like this.
private SortOrder sortOrder;

private int MyIntComparer(int value1, int value2)
{
    switch (sortOrder)
    {
        case SortOrder.Ascending:
            return value1.CompareTo(value2);
        case SortOrder.Descending:
            return -(value1.CompareTo(value2));
        default:
            return 1;
    }
}

Then just call Sort(MyIntComparer) on whatever collection your ints are in. The example below adds them to a List<int>
int i = 2;
int j = 3;
int k = 1;
List<int> intList = new List<int>();
intList.Add(i);
intList.Add(j);
intList.Add(k);
sortOrder = SortOrder.Ascending; // change enum value as required
intList.Sort(MyIntComparer);
foreach (int item in intList)
{
    Console.WriteLine(item);
}


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Expect everything to be hard and then enjoy the things that come easy. (code-frog)

GeneralRe: Help incase of Sorting with .net Framework Pin
tasumisra11-Sep-08 1:41
tasumisra11-Sep-08 1:41 
QuestionSkipping of Code While Converting the Char to Bytes Pin
tauras8111-Sep-08 0:34
tauras8111-Sep-08 0:34 
AnswerRe: Skipping of Code While Converting the Char to Bytes Pin
stancrm11-Sep-08 0:38
stancrm11-Sep-08 0:38 
AnswerRe: Skipping of Code While Converting the Char to Bytes Pin
Guffa11-Sep-08 1:46
Guffa11-Sep-08 1:46 
QuestionSelecting certain data in a datagrid and Export it to Excel??? Pin
Twyce10-Sep-08 23:43
Twyce10-Sep-08 23:43 
Questionregex.matches ? Pin
enginço10-Sep-08 23:17
enginço10-Sep-08 23:17 
AnswerRe: regex.matches ? Pin
leppie10-Sep-08 23:33
leppie10-Sep-08 23:33 
GeneralRe: regex.matches ? Pin
enginço10-Sep-08 23:43
enginço10-Sep-08 23:43 
AnswerRe: regex.matches ? Pin
leppie10-Sep-08 23:50
leppie10-Sep-08 23:50 
GeneralRe: regex.matches ? Pin
enginço11-Sep-08 0:09
enginço11-Sep-08 0:09 
GeneralRe: regex.matches ? Pin
leppie11-Sep-08 1:14
leppie11-Sep-08 1:14 
GeneralRe: regex.matches ? [modified] Pin
enginço11-Sep-08 1:24
enginço11-Sep-08 1:24 
QuestionCommunicate with a C++ server. Pin
CodingLover10-Sep-08 23:10
CodingLover10-Sep-08 23:10 
AnswerRe: Communicate with a C++ server. Pin
leppie10-Sep-08 23:34
leppie10-Sep-08 23:34 
QuestionRe: Communicate with a C++ server. Pin
CodingLover10-Sep-08 23:40
CodingLover10-Sep-08 23:40 
AnswerRe: Communicate with a C++ server. Pin
leppie10-Sep-08 23:43
leppie10-Sep-08 23:43 
GeneralRe: Communicate with a C++ server. Pin
CodingLover11-Sep-08 17:44
CodingLover11-Sep-08 17:44 

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.