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

C#

 
AnswerRe: add control to listBox Pin
Andrew Lygin10-Jul-06 10:07
Andrew Lygin10-Jul-06 10:07 
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 
Hi!

I have a ListView with two date-columns, "started", and "ended". I want them all to be sorted on the "started" column, but I want all the rows without an "ended" value separated and displayed before rows with "ended" value, like this:

Started Ended

050101
051110
051231
050101 061231
050910 061231

Ive done an ListViewItemSorter thingie, but I can't seem to make it sort with two separate columns:

class ListViewSortering : IComparer <br />
    {<br />
        private int col;<br />
        public ListViewSortering() <br />
        {<br />
            col=0;<br />
        }<br />
        public ListViewSortering(int column) <br />
        {<br />
            col=column;<br />
        }<br />
        public int Compare(object x, object y) <br />
        {<br />
                            return -String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);<br />
        }<br />
    }


And the call:

	this.wmLvInsatser.Sorting = SortOrder.None;<br />
// 1 = started column<br />
				this.wmLvInsatser.ListViewItemSorter = new ListViewSortering(1);<br />
				<br />
				this.wmLvInsatser.Sort();


Can anyone point me in the right direction?



-- modified at 7:27 Monday 10th July, 2006
AnswerRe: ListViewItemSorter and Icomparer Pin
Robert Rohde10-Jul-06 3:24
Robert Rohde10-Jul-06 3:24 
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 

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.