How do i get the selected rows number

Posted by: unclechao on 8 September 2017, 2:55 pm EST

  • Posted 8 September 2017, 2:55 pm EST

    i want to delete the rows where i selected,but i don't know how to get the rows number i selected,are there some examples for this?
  • Replied 8 September 2017, 2:55 pm EST


    You can use the GetSelections method to get the row number for all the rows selected on the sheet, and using the same you can delete those specific rows. You can refer to the following link for further clarification of the GetSelections method:

    And here is the code to accomplish the same:

                                                  private void button1_Click(object sender, EventArgs e)
                                                      foreach (FarPoint.Win.Spread.Model.CellRange cr in fpSpread1.Sheets[0].GetSelections())
                                                                  fpSpread1.Sheets[0].RemoveRows(cr.Row, cr.RowCount);

    Hope it will help you. Please let me know if you have any queries further.


    Manpreet Kaur

  • Replied 8 September 2017, 2:55 pm EST

    Thank U vary much for u help
Need extra support?

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

Learn More

Forum Channels