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

    <P>Dropdown list of autofilter is shown as below  for numerical data.</P>
    <P>1</P>
    <P>11</P>
    <P>110</P>
    <P>111</P>
    <P>112</P>
    <P>113</P>
    <P>I want the drop down list of the autofilter should be shown as below for numerical data.</P>
    <P>1</P>
    <P>2</P>
    <P>3</P>
    <P>4</P>
    <P>5</P>
    <P>6</P>
    <P>7</P>
    <P>8</P>
    <P>9</P>
    <P>10</P>
    <P>11</P>
    <P>12</P>
    <P>13</P>
    <P>and so on </P>
  • Replied 8 September 2017, 3:06 pm EST

    <p>Hello,</p><p>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. <br><br>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.</p><p>Thanks,</p><p>Manpreet Kaur <br></p>
    2013/03/FilterNumericData.zip
  • Replied 8 September 2017, 3:06 pm EST

    <P>Thanks a lot for your help. it solved my problem.</P>
  • Replied 8 September 2017, 3:06 pm EST

    <P>Hello,</P>
    <P> i hv another request, I have formated the view of the particular column with below code</P><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P>FarPoint.Win.Spread.CellType.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>GeneralCellType</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> cell = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>new</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> FarPoint.Win.Spread.CellType.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>GeneralCellType</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>();</P>
    <P>cell.FormatString = </FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"000"</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>;</P>
    <P>fpSpread1.ActiveSheet.Columns[2].CellType = cell;</P>
    <P>to show in 3 digit format like  1 will be shown as 001 and 2 will be 002 am=nd so on....</P>
    <P>but when i click on the filter icon the drop down list shows as below</P>
    <P>1</P>
    <P>2</P>
    <P>3</P>
    <P>and so on </P>
    <P>but i want the drop down list to be shown as below</P>
    <P>001</P>
    <P>002</P>
    <P>003</P>
    <P>and so on..</P>
    <P>pls help </P>
    <P>regards,</P>
    <P>Amulya Verma.</P></FONT></FONT>
  • Replied 8 September 2017, 3:06 pm EST

    <p>Hello,</p><p>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.</p><p>Thanks,</p><p>Manpreet Kaur <br></p>
    2013/03/FormatFilter.zip
  • Replied 8 September 2017, 3:06 pm EST

    <P>Thank you very much</P>
    <P>i got the solution</P>
    <P>Regards</P>
    <P>Amulya verma</P>
Need extra support?

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

Learn More

Forum Channels