how to delete selected row

Posted by: redahashem-fp on 8 September 2017, 2:03 pm EST

  • Posted 8 September 2017, 2:03 pm EST

    i know when i need to delete row


    FpSpread1.Sheets(0).Rows.Count - = 1


    but that will delete the last row


    i need to delete the active row or selected row


    thanks 4 help


     

  • Replied 8 September 2017, 2:03 pm EST

    Hello,

    To delete the selected row, you can use the following:

            Dim cr As FarPoint.Win.Spread.Model.CellRange
            cr = FpSpread1.Sheets(0).GetSelection(0)
            FpSpread1.Sheets(0).RemoveRows(cr.Row, cr.RowCount)

    Thanks

  • Replied 8 September 2017, 2:03 pm EST

    SureshD:

    Hello,


    To delete the selected row, you can use the following:



            Dim cr As FarPoint.Win.Spread.Model.CellRange
            cr = FpSpread1.Sheets(0).GetSelection(0)
            FpSpread1.Sheets(0).RemoveRows(cr.Row, cr.RowCount)


    Thanks



     


    that gives me error but i try that and worked nice


    FpSpread1.Sheets(0).ActiveRow.Remove()


    that code deleted the active row

  • Replied 8 September 2017, 2:03 pm EST

    Hello,

    Thank you for letting us know that you were able to get the desired behavior. However, my code snippet is working fine at my side and it deletes the selected row/rows from the sheet, whereas your snippet removes the ActiveRow (which is currently selected).

    Thanks

Need extra support?

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

Learn More

Forum Channels