sortinfo

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

  • Posted 8 September 2017, 2:44 pm EST

    Hi

    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) = New FarPoint.Win.Spread.SortInfo(x, True, System.Collections.Comparer.Default)


    s1(1) = New FarPoint.Win.Spread.SortInfo(y, True, System.Collections.Comparer.Default)

    s1(2) = New FarPoint.Win.Spread.SortInfo(-1, True, System.Collections.Comparer.Default)

     s2(2) is populated as

    s2(0) = New FarPoint.Win.Spread.SortInfo(a, false, System.Collections.Comparer.Default)

    s2(1) = New FarPoint.Win.Spread.SortInfo(b, True, System.Collections.Comparer.Default)

    s2(2) = New FarPoint.Win.Spread.SortInfo(-1, True, System.Collections.Comparer.Default)

    how to find whether s1 is same as s2

    parthiv

  • 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.

    Thanks,

    Manpreet Kaur.


    2011/09/sortinfocomparison.zip
  • 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

    parthiv

  • Replied 8 September 2017, 2:44 pm EST

    Hello,

    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.

    Thanks,

    Manpreet Kaur.

Need extra support?

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

Learn More

Forum Channels