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:<br><pre class="coloredcode"> FarPoint.Win.Spread.Model.CellRange[] cr = <span class="kwd">this</span>.fpSpread1_Sheet1.GetSelections();
    <span class="kwd">int</span> start = cr[0].Row;
    <span class="kwd">int</span> len = cr[0].RowCount;
    String msg = <span class="st">""</span>;
    <span class="kwd">for</span> (<span class="kwd">int</span> i = start; i < start+len; i++)
    msg += i + <span class="st">") "</span> + <span class="kwd">this</span>.fpSpread1_Sheet1.Cells[i, 1].Value.ToString() + <span class="st">"\r\n"</span>;
    MessageBox.Show(msg);</pre> <br>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:<br><br>name1   1<br>name2   2<br>name4  88<br>name1   3<br><br>and I use autofilter to display only rows with value 'name1' and then select them, rows with 'name2' and 'name4' will also be selected. <br><br>Is it possible the getselection()/getselections() methods to select only rows which are visible?<br><br>
  • Replied 8 September 2017, 12:42 pm EST

    <P>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.</P>
  • Replied 8 September 2017, 12:42 pm EST

    It worked, thanks.<br>
Need extra support?

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

Learn More

Forum Channels