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

C#

 
AnswerRe: mouse position + map lon/lat C# Pin
Christian Graus6-Jul-07 1:57
protectorChristian Graus6-Jul-07 1:57 
GeneralRe: mouse position + map lon/lat C# Pin
mercenary016-Jul-07 2:00
mercenary016-Jul-07 2:00 
GeneralRe: mouse position + map lon/lat C# Pin
Christian Graus6-Jul-07 2:07
protectorChristian Graus6-Jul-07 2:07 
QuestionHow to sort images in column of datagridview Pin
goldenchance6-Jul-07 0:49
goldenchance6-Jul-07 0:49 
AnswerRe: How to sort images in column of datagridview Pin
Chintan.Desai6-Jul-07 2:20
Chintan.Desai6-Jul-07 2:20 
GeneralRe: How to sort images in column of datagridview Pin
goldenchance6-Jul-07 3:14
goldenchance6-Jul-07 3:14 
AnswerRe: How to sort images in column of datagridview Pin
Chintan.Desai8-Jul-07 20:43
Chintan.Desai8-Jul-07 20:43 
GeneralRe: How to sort images in column of datagridview Pin
goldenchance8-Jul-07 21:12
goldenchance8-Jul-07 21:12 
Thanks Chintan for your warm and kind help.

I solved my problem by using IComparer interface. I have a object and image is one of its many properties, I wrote a lass for compare to object, and property used for compare is the image type (each product have 1 image type).And the last, I create an array list and sort all this array follows my new class which implements from IComparer.
<br />
public enum SortDirection<br />
    {<br />
        Ascending,<br />
        Descending<br />
    }<br />
    class ElementSorting : IComparer<br />
    {<br />
<br />
        private SortDirection m_direction = SortDirection.Ascending;<br />
<br />
        public ElementSorting() : base() { }<br />
<br />
        public ElementSorting(SortDirection direction)<br />
        {<br />
            this.m_direction = direction;<br />
        }<br />
<br />
        int IComparer.Compare(object x, object y)<br />
        {<br />
<br />
            ABCElement elementX = (ABCElement)x;<br />
            ABCElement elementY = (ABCElement)y;<br />
<br />
            if (elementX == null && elementY == null)<br />
            {<br />
                return 0;<br />
            }<br />
            else if (elementX == null && elementY != null)<br />
            {<br />
                return (this.m_direction == SortDirection.Ascending) ? -1 : 1;<br />
            }<br />
            else if (elementX != null && elementY == null)<br />
            {<br />
                return (this.m_direction == SortDirection.Ascending) ? 1 : -1;<br />
            }<br />
            else<br />
            {<br />
                return (this.m_direction == SortDirection.Ascending) ?<br />
                 elementX.Type.CompareTo(elementY.Type) :<br />
                 elementY.Type.CompareTo(elementX.Type);<br />
            }<br />
        }<br />
    }<br />



Thanks

Banana

QuestionDataGridViewControl Pin
sangramkp6-Jul-07 0:40
sangramkp6-Jul-07 0:40 
QuestionHow to make data from one form available to another Pin
I.explore.code6-Jul-07 0:38
I.explore.code6-Jul-07 0:38 
AnswerRe: How to make data from one form available to another Pin
rah_sin6-Jul-07 0:47
professionalrah_sin6-Jul-07 0:47 
GeneralRe: How to make data from one form available to another Pin
Christian Graus6-Jul-07 0:55
protectorChristian Graus6-Jul-07 0:55 
QuestionRe: How to make data from one form available to another Pin
I.explore.code6-Jul-07 1:01
I.explore.code6-Jul-07 1:01 
AnswerRe: How to make data from one form available to another Pin
Christian Graus6-Jul-07 1:35
protectorChristian Graus6-Jul-07 1:35 
AnswerRe: How to make data from one form available to another Pin
Christian Graus6-Jul-07 0:56
protectorChristian Graus6-Jul-07 0:56 
GeneralRe: How to make data from one form available to another Pin
I.explore.code6-Jul-07 1:05
I.explore.code6-Jul-07 1:05 
GeneralRe: How to make data from one form available to another Pin
Christian Graus6-Jul-07 1:36
protectorChristian Graus6-Jul-07 1:36 
GeneralRe: How to make data from one form available to another Pin
I.explore.code6-Jul-07 1:13
I.explore.code6-Jul-07 1:13 
AnswerRe: How to make data from one form available to another Pin
Giorgi Dalakishvili6-Jul-07 1:11
mentorGiorgi Dalakishvili6-Jul-07 1:11 
AnswerRe: How to make data from one form available to another Pin
Chintan.Desai6-Jul-07 2:26
Chintan.Desai6-Jul-07 2:26 
QuestionMultiple Instance Closure Pin
ramdil6-Jul-07 0:25
ramdil6-Jul-07 0:25 
AnswerRe: Multiple Instance Closure Pin
Pete O'Hanlon6-Jul-07 1:06
mvePete O'Hanlon6-Jul-07 1:06 
GeneralRe: Multiple Instance Closure Pin
ramdil6-Jul-07 8:52
ramdil6-Jul-07 8:52 
QuestionC# how to get mouseover pos on a picture Pin
mercenary015-Jul-07 23:40
mercenary015-Jul-07 23:40 
AnswerRe: C# how to get mouseover pos on a picture Pin
Martin#5-Jul-07 23:46
Martin#5-Jul-07 23:46 

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.