Posted by: parthiv on 8 September 2017, 2:44 pm EST

  • Posted 8 September 2017, 2:44 pm EST


    I have created two sortinfo array: s1 and s2 with 3 elements each. s1 and s2 takes different values at different time. I want to know how to compare the two arrays?

    e.g. s1(2) is populated as

     s1(0) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(x, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)

    s1(1) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(y, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)

    s1(2) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(-1, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)

     s2(2) is populated as

    s2(0) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(a, <font color="#0000ff">false</font>, System.Collections.Comparer.Default)

    s2(1) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(b, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)

    s2(2) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(-1, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)

    how to find whether s1 is same as s2


  • Replied 8 September 2017, 2:44 pm EST

    Hello Parthiv,

    I would suggest you to compare each property of each element in the first array with the corresponding property of each element in the second array to find out whether the first array is same as the second array. I have created a sample depicting the same which I am attaching with this response, kindly have a look and please let me know if you have any queries further.

    Hope it will help you.


    Manpreet Kaur.

  • Replied 8 September 2017, 2:44 pm EST

    yes, its working. thanx. can u let me know what happens if we give the index value as -1


  • Replied 8 September 2017, 2:44 pm EST


    When we pass -1 as the index value, it considers the active column or the active row to be the key column or key row on the basis of which it performs the sorting, but the sorting is performed in some random order so you do not actually get the desired result. Hence, I would suggest you to pass some valid column index or row index to the index parameter in the SortInfo constructor, to get the desired result. Hope it helps you.


    Manpreet Kaur.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels