sortinfo

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

  • Posted 8 September 2017, 2:44 pm EST

    <p>Hi
    </p><p>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? </p><p>e.g. s1(2) is populated as</p><p> s1(0) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(x, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)</p><p>
    s1(1) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(y, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)</p><p>s1(2) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(-1, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)</p><p> s2(2) is populated as</p><p> s2(0) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(a, <font color="#0000ff">false</font>, System.Collections.Comparer.Default)</p><p> s2(1) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(b, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)</p><p>s2(2) = <font color="#0000ff">New</font> FarPoint.Win.Spread.SortInfo(-1, <font color="#0000ff">True</font>, System.Collections.Comparer.Default)</p><p>how to find whether s1 is same as s2</p><p>parthiv</p>
  • Replied 8 September 2017, 2:44 pm EST

    <p>Hello Parthiv,</p><p>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.</p><p>Hope it will help you.</p><p>Thanks,</p><p>Manpreet Kaur. <br></p>
    2011/09/sortinfocomparison.zip
  • Replied 8 September 2017, 2:44 pm EST

    <p>yes, its working. thanx. can u let me know what happens if we give the index value as -1</p><p>parthiv</p>
  • Replied 8 September 2017, 2:44 pm EST

    <p>Hello,</p><p>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.</p><p>Thanks,</p><p>Manpreet Kaur. <br></p>
Need extra support?

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

Learn More

Forum Channels