sorting rows on more than one column

Posted by: parez81-fp on 8 September 2017, 1:12 pm EST

  • Posted 8 September 2017, 1:12 pm EST

    Hi<br><br>Is it possible sort rows on more than one column??<br>Programmticallyl and using the grid?<br><br>I currently use <br><br> ui_userList.ActiveSheet.SortRows(2, true, false);<br><br>
  • Replied 8 September 2017, 1:12 pm EST

    You can create a sortinfo:<br><br><code class="CS">fpSpread1.ActiveSheet.SetValue(0, 0, "S"); <br>fpSpread1.ActiveSheet.SetValue(0, 1, "E"); <br>fpSpread1.ActiveSheet.SetValue(0, 2, "A"); <br>fpSpread1.ActiveSheet.SetValue(0, 3, "K"); <br>fpSpread1.ActiveSheet.SetValue(1, 0, "W"); <br>fpSpread1.ActiveSheet.SetValue(1, 1, "G"); <br>fpSpread1.ActiveSheet.SetValue(1, 2, "P"); <br>fpSpread1.ActiveSheet.SetValue(1, 3, "V"); <br>fpSpread1.ActiveSheet.SetValue(2, 0, "O"); <br>fpSpread1.ActiveSheet.SetValue(2, 1, "L"); <br>fpSpread1.ActiveSheet.SetValue(2, 2, "Q"); <br>fpSpread1.ActiveSheet.SetValue(2, 3, "H"); <br>FarPoint.Win.Spread.SortInfo[] sort = new FarPoint.Win.Spread.SortInfo[1]; <br>sort[0] = new FarPoint.Win.Spread.SortInfo(0, true, System.Collections.Comparer.Default); <br>fpSpread1.ActiveSheet.SortRows(0, 1, sort);<br><br>or <br><br></code><code class="CS">FarPoint.Win.Spread.SortInfo[] sort = new FarPoint.Win.Spread.SortInfo[1]; <br>sort[0] = new FarPoint.Win.Spread.SortInfo(0, false, System.Collections.Comparer.Default); <br>fpSpread1.ActiveSheet.SetValue(0, 0, "S"); <br>fpSpread1.ActiveSheet.SetValue(0, 1, "E"); <br>fpSpread1.ActiveSheet.SetValue(0, 2, "A"); <br>fpSpread1.ActiveSheet.SetValue(0, 3, "K"); <br>fpSpread1.ActiveSheet.SetValue(1, 0, "W"); <br>fpSpread1.ActiveSheet.SetValue(1, 1, "G"); <br>fpSpread1.ActiveSheet.SetValue(1, 2, "P"); <br>fpSpread1.ActiveSheet.SetValue(1, 3, "V"); <br>fpSpread1.ActiveSheet.SetValue(2, 0, "O"); <br>fpSpread1.ActiveSheet.SetValue(2, 1, "L"); <br>fpSpread1.ActiveSheet.SetValue(2, 2, "Q"); <br>fpSpread1.ActiveSheet.SetValue(2, 3, "H"); <br>fpSpread1.ActiveSheet.SortColumns(0, 2, sort);</code><br>
Need extra support?

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

Learn More

Forum Channels