Rowfilter Help Needed

Posted by: brwood on 27 March 2018, 10:59 pm EST

    • Post Options:
    • Link

    Posted 27 March 2018, 10:59 pm EST

    Good Morning. Here is what i’m trying to accomplish :

    I have a grid with several different columns. At the click of a button, I want the grid to programmatically rowfilter to only show certain rows.

    For example : Show if values in column A are greater than 50

    I am assuming I want to use a hiderowfilter? If so can you provide any type of basic code example for this?

    Also, They may want to filter by multiple things at a time :

    For example : Show if values in column A are greater than 50 AND values in column D are less than 10.

    Is this possible as well?

    Thanks for your help.

  • Posted 27 March 2018, 11:00 pm EST

    Also, I want these rowfilters to happen entirely in code. Not through them clicking on a filter list.

  • Posted 28 March 2018, 10:34 pm EST

    Hello,

    You can use the AutoFilterColumn method to filter in code .

    Here is the code snippet to implement the same, you can write the code in a button click event and clicking on the same would filter the rows in Spread based on one value in a specific column:

        ```
      fpSpread1.ActiveSheet.Columns[1].AllowAutoFilter = true;
              fpSpread1.ActiveSheet.AutoFilterColumn(1, "Flash",1); // 'Flash' is the value which is be used to filter 
              fpSpread1.ActiveSheet.RowFilter.ShowFilterIndicator = false;
    
    
    Please refer to the documentation given here:
    http://help.grapecity.com/spread/SpreadNet11/WF/webframe.html#FarPoint.Win.Spread~FarPoint.Win.Spread.SheetView~AutoFilterColumn(Int32,String,Int32).html
    
    Hope it will help you. Please let me know if you have any queries further.
    Thanks,
    Deepak Sharma
Need extra support?

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

Learn More

Forum Channels