Click here to Skip to main content
15,895,370 members
Home / Discussions / C#
   

C#

 
Questionms access problem :( help please ... Pin
cmpeng3410-Jul-06 2:38
cmpeng3410-Jul-06 2:38 
AnswerRe: ms access problem :( help please ... Pin
LongRange.Shooter10-Jul-06 4:13
LongRange.Shooter10-Jul-06 4:13 
Questionchange WindowsForm Pin
realmontanakid10-Jul-06 2:25
realmontanakid10-Jul-06 2:25 
AnswerRe: change WindowsForm Pin
stancrm10-Jul-06 2:36
stancrm10-Jul-06 2:36 
GeneralRe: change WindowsForm Pin
Jun Du10-Jul-06 4:36
Jun Du10-Jul-06 4:36 
AnswerRe: change WindowsForm Pin
Andrei Ungureanu10-Jul-06 3:37
Andrei Ungureanu10-Jul-06 3:37 
QuestionListViewItemSorter and Icomparer [modified] Pin
livez10-Jul-06 1:26
livez10-Jul-06 1:26 
AnswerRe: ListViewItemSorter and Icomparer Pin
Robert Rohde10-Jul-06 3:24
Robert Rohde10-Jul-06 3:24 
Hi,

the following modification should work:
class ListViewSortering : IComparer
{
   private int colStart;
   private int colEnd;

   public ListViewSortering()
   {
      colStart=0;
      colEnd=0;
   }

   public ListViewSortering(int columnStart, int columnEnd)
   {
      colStart=columnStart;
      colEnd=columnEnd;
   }

   public int Compare(object x, object y)
   {
      ListViewItem lvi1 = (ListViewItem)x;
      ListViewItem lvi2 = (ListViewItem)y;

      string start1 = lvi1.SubItems[colStart].Text;
      string end1 = lvi1.SubItems[colEnd].Text;
      string start2 = lvi2.SubItems[colStart].Text;
      string end2 = lvi2.SubItems[colEnd].Text;

      if (end1.Length == 0 && end2.Length > 0)
         return -1;
      if (end1.Length > 0 && end.Length == 0)
         return 1;

      return -String.Compare(start1, start2);
   }
}

So basically when only one of both items doesn't have an end date you'll return a special result value. In all other cases the normal comparison is done.

Robert
GeneralRe: ListViewItemSorter and Icomparer [modified] Pin
livez10-Jul-06 3:41
livez10-Jul-06 3:41 
QuestionWord DOC To String Pin
eraserk10-Jul-06 1:19
eraserk10-Jul-06 1:19 
AnswerRe: Word DOC To String Pin
stancrm10-Jul-06 1:24
stancrm10-Jul-06 1:24 
AnswerRe: Word DOC To String Pin
Not Active10-Jul-06 2:19
mentorNot Active10-Jul-06 2:19 
GeneralRe: Word DOC To String Pin
eraserk10-Jul-06 2:42
eraserk10-Jul-06 2:42 
Questionbutton appearance remain unchanged after VS2005 conversion Pin
Kim061810-Jul-06 1:09
Kim061810-Jul-06 1:09 
GeneralRe: button appearance remain unchanged after VS2005 conversion Pin
Guffa10-Jul-06 2:35
Guffa10-Jul-06 2:35 
AnswerRe: button appearance remain unchanged after VS2005 conversion Pin
LongRange.Shooter10-Jul-06 4:15
LongRange.Shooter10-Jul-06 4:15 
GeneralRe: button appearance remain unchanged after VS2005 conversion Pin
Kim061810-Jul-06 7:08
Kim061810-Jul-06 7:08 
GeneralRe: button appearance remain unchanged after VS2005 conversion Pin
LongRange.Shooter10-Jul-06 8:04
LongRange.Shooter10-Jul-06 8:04 
GeneralRe: button appearance remain unchanged after VS2005 conversion Pin
Kim061810-Jul-06 9:59
Kim061810-Jul-06 9:59 
AnswerRe: button appearance remain unchanged after VS2005 conversion Pin
Joel Lucsy10-Jul-06 13:13
Joel Lucsy10-Jul-06 13:13 
QuestionHow 2 get Printer details? Pin
rajkar00110-Jul-06 1:04
rajkar00110-Jul-06 1:04 
AnswerRe: How 2 get Printer details? Pin
stancrm10-Jul-06 1:20
stancrm10-Jul-06 1:20 
GeneralRe: How 2 get Printer details? Pin
rajkar00110-Jul-06 1:24
rajkar00110-Jul-06 1:24 
QuestionDebug ActiveX control from C# application Pin
Maddie from Dartford10-Jul-06 0:02
Maddie from Dartford10-Jul-06 0:02 
AnswerRe: Debug ActiveX control from C# application Pin
VSush10-Jul-06 0:29
VSush10-Jul-06 0:29 

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.