Dropdown list of autofilter for numerical data

Posted by: amulya on 8 September 2017, 3:06 pm EST

  • Posted 8 September 2017, 3:06 pm EST

    Dropdown list of autofilter is shown as below  for numerical data.


    1


    11


    110


    111


    112


    113


    I want the drop down list of the autofilter should be shown as below for numerical data.


    1


    2


    3


    4


    5


    6


    7


    8


    9


    10


    11


    12


    13


    and so on

  • Replied 8 September 2017, 3:06 pm EST

    Hello,

    FilterColumnDefinition.ListBehavior determines how the
    filter list is initialized.  The default behavior uses
    FilterListBehavior.Default, which is a combination of Blank, NonBlank,
    and SortAlphabetically, but you can change it to use Custom and define
    the list using one or more custom filter item classes inheriting from
    DefaultFilterItem or BaseFilterItem.  The default behavior uses
    DefaultFilterItem, which includes all unique values in the column and
    the Blank and NonBlank items in the filter list.  A custom filter item
    gives you control over how the filtering is performed and how the item
    is displayed in the list.

    Please have a look at the attached sample in which I define a custom filter to add items to the drop down list in the numeric order. Hope it helps.

    Thanks,

    Manpreet Kaur


    2013/03/FilterNumericData.zip
  • Replied 8 September 2017, 3:06 pm EST

    Thanks a lot for your help. it solved my problem.

  • Replied 8 September 2017, 3:06 pm EST

    Hello,


     i hv another request, I have formated the view of the particular column with below code


    FarPoint.Win.Spread.CellType.GeneralCellType cell = new FarPoint.Win.Spread.CellType.GeneralCellType();


    cell.FormatString = "000";


    fpSpread1.ActiveSheet.Columns[2].CellType = cell;


    to show in 3 digit format like  1 will be shown as 001 and 2 will be 002 am=nd so on....


    but when i click on the filter icon the drop down list shows as below


    1


    2


    3


    and so on


    but i want the drop down list to be shown as below


    001


    002


    003


    and so on..


    pls help


    regards,


    Amulya Verma.

  • Replied 8 September 2017, 3:06 pm EST

    Hello,

    I was not able to replicate the issue at my end. Please refer to the attached sample used for testing. Could you please modify the attached sample to depict your issue so that I can replicate the issue at my end and debug it further.

    Thanks,

    Manpreet Kaur


    2013/03/FormatFilter.zip
  • Replied 8 September 2017, 3:06 pm EST

    Thank you very much


    i got the solution


    Regards


    Amulya verma

Need extra support?

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

Learn More

Forum Channels