Sorting and Filtering

Posted by: hpadmasola1 on 8 September 2017, 2:06 pm EST

  • Posted 8 September 2017, 2:06 pm EST

    Hi,


     I have the sorting and filtering enabled on my Spread control. Both seem to be working fine.  Currently, I dont have a icon on the column displaying the sort order and the filter (like in excel). How can I achieve that (put icons on the columns to show sort and filtering so users can click on it) ?


    Thanks in advance


    Harish

  • Replied 8 September 2017, 2:06 pm EST

    Hello Harish,

    You may set "ShowSortIndicator" and "ShowFilterIndicator"  properties for a Column to True show the Indicators for Sorting and Fitering e.g.

           Dim col As FarPoint.Win.Spread.Column
            col = FpSpread1.ActiveSheet.Columns(2)
            FpSpread1.ActiveSheet.Columns(2).AllowAutoFilter = True  ' using this way of putting Filter doesn;t need to set the ShowFilterIndicator to true.
            FpSpread1.ActiveSheet.Columns(2).AllowAutoSort = True    'using this way of applying Sorting to a column automatically Show the SortIndicator.
            FpSpread1.ActiveSheet.RowFilter.ShowFilterIndicator = False
            col.SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.None
            col.ShowSortIndicator = False

    I hope it helps.

    Thanks,

  • Replied 8 September 2017, 2:06 pm EST

     


    Deepak,


     It does not seem to work. I tried all those properties. Here is my code that Iam using.


            Dim col As FarPoint.Win.Spread.Column
            Dim size As Single


            For i = 0 To FPSpread1.ActiveSheet.Columns.Count - 1
                col = FPSpread1.ActiveSheet.Columns(i)
                size = col.GetPreferredWidth()
                col.Width = size
                FPSpread1.ActiveSheet.Columns(i).ShowSortIndicator = True
                FPSpread1.ActiveSheet.Columns(i).SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.Ascending
                FPSpread1.ActiveSheet.RowFilter.ShowFilterIndicator = True
              
            Next

  • Replied 8 September 2017, 2:06 pm EST

    Hello,

    I used the code as same as I posted in my last post and I am not able to replicate the issue.I am able to show the Sort and Filter Indicators Using Spread for Windows Forms Version 4.0.2012.2005.

    I have attached a Jpeg image that shows the same. I would request you to test it with the latest build thatof Spread for Windows Forms and please post a small zipped project if the issue still persists.

    Thanks,

     

     


    2009/10/ShowFilter&SortIndicator.rar
Need extra support?

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

Learn More

Forum Channels