multiple row selection problem

Posted by: adamg on 8 September 2017, 12:42 pm EST

  • Posted 8 September 2017, 12:42 pm EST

     Hi, I'm having problems getting selections behave as I would like it them to. I am using the following code:
                FarPoint.Win.Spread.Model.CellRange[] cr = this.fpSpread1_Sheet1.GetSelections();
    int start = cr[0].Row;
    int len = cr[0].RowCount;
    String msg = "";
    for (int i = start; i < start+len; i++)
    msg += i + ") " + this.fpSpread1_Sheet1.Cells[i, 1].Value.ToString() + "\r\n";
    Which works well until user uses autofiltering, the rows that are not visible (now satistifying filter condition) are also selected, which means that if the rows look like:

    name1   1
    name2   2
    name4  88
    name1   3

    and I use autofilter to display only rows with value 'name1' and then select them, rows with 'name2' and 'name4' will also be selected.

    Is it possible the getselection()/getselections() methods to select only rows which are visible?

  • Replied 8 September 2017, 12:42 pm EST


    This is the correct behavior of the Spread control. You need to use the IsRowFilteredOut method to determine if the row is visible or not in the filtered list.

  • Replied 8 September 2017, 12:42 pm EST

    It worked, thanks.
Need extra support?

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

Learn More

Forum Channels