Is it possible to sort a column by numerical Value?

Posted by: tyree.jackson on 5 February 2024, 11:33 am EST

  • Posted 5 February 2024, 11:33 am EST

    Like the Title says, I’m having trouble sorting. Whenever the user clicks on a column sort button it currently sorts based on the value of the first character instead of the whole integer.

    For example, if the user wants to view the number column descending, It goes

    -1

    -11

    -12

    -21

    -22

    and so on

    Is there a way I can have it be sorted based on the numerical value?

  • Posted 5 February 2024, 11:18 pm EST - Updated 5 February 2024, 11:23 pm EST

    Hi Tyree,

    The behavior that you have specified, can be replicated for text type cells in a column. If you add numeric values in a column cell and apply sorting to it, then the cells will be sorted based on the numeric values itself. Please see the following GIF to see the behavior:

    You can also check the following GIF to check the cell types set for the column cells:

    Kindly refer to the attached sample for full implementation. See CustomSort.zip

    In case you have any further issues regarding this, we request you provide a small sample or update the attached sample so that we can understand your use-case scenario in a better way. Additionally, please provide the following environment details:

    1. OS version
    2. VS version
    3. Spread.NET exact build used
    4. Application target framework

    Thanks & Regards,

    Aastha

  • Posted 6 February 2024, 4:33 am EST

    May you show me a gif of where the column is sorting the based on the numerical value, please?

  • Posted 6 February 2024, 8:37 pm EST - Updated 6 February 2024, 8:42 pm EST

    Hi Tyree,

    You can see numeric sort on the first column named “Default Cell Type”. Please check the following GIF to see the numeric sort on a column:

    We have again attached the sample implementation of the same. See CustomSort.zip

    If your use-case scenario differs, please provide a stripped-down version of your sample application or update the attached sample for a better understanding of your use-case scenario. Additionally, please provide the following environment details:

    1. OS version
    2. VS version
    3. Exact build version of Spread.NET used
    4. Application target framework

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels