Spread sheetview sorting

Posted by: arthi-prasad on 8 September 2017, 1:02 pm EST

  • Posted 8 September 2017, 1:02 pm EST


    I'm using far point spread sheet . Currently to sort the rows in the spread sheet i have written the following sortrows function.

    <FONT color=#ff0000 size=2>

    sheetView.SortRows(0, sheetView.Rows.Count, sortInfo)

    <FONT color=#000000>If i use this the sorting takes place as follows in Current scenario:</FONT>

    <FONT color=#000000>When i try to sort a column in both ascending and descending order , all the special characters appears first followed by data with numbers, then with A...Z  followed by empty values in ascending order and vice versa in descending except empty values. The empty values appear at the end.</FONT>

    <FONT color=#000000>But i need the sorting to take place as follows:</FONT>

    <FONT color=#000000>If i sort a column in ascending order,empty values should come on top(The result should be displyed the same way as we get from the database thro query using sort by).</FONT>

    <FONT color=#000000>Could you please suggest a solution for this?</FONT>

    <FONT color=#000000>Thanks,</FONT>

    <FONT color=#000000>Arthi</FONT>

  • Replied 8 September 2017, 1:02 pm EST

    Arthi -

    What version are you using?  When I sort ascending the empty values are on top.  Make sure you have the latest maintenance release for the version you have.  Also, how are you defining the empty values?
  • Replied 8 September 2017, 1:02 pm EST


    Thanks for ur reply.

    The far point version i'm using is 2.5.

    The empty values are just empty string.



  • Replied 8 September 2017, 1:02 pm EST


    The results you are seeing with the Spread sorting is expected behavior. This has been the behavior of the Spread sorting (not to sort the blank cells) since the version 1 of Spread. If you want a different sort order, you would need to implement a new IComparer interface to pass in to the Sort method.

  • Replied 8 September 2017, 1:02 pm EST

    <FONT face=Tahoma size=2>Hi Scott,</FONT>

    <FONT face=Tahoma size=2>Due you have any code sample on how to implement IComparer interface?</FONT>

    <FONT face=Tahoma size=2>Thanks, Arthi</FONT>

  • Replied 8 September 2017, 1:02 pm EST

    Arthi -

    Have a look at the following posts...


Need extra support?

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

Learn More

Forum Channels