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

    <FONT size=2>

    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


     

    </FONT>
  • Replied 8 September 2017, 2:03 pm EST

    Hello,

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

    <blockquote>

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

    </blockquote>

    Thanks

  • Replied 8 September 2017, 2:03 pm EST

    <BLOCKQUOTE><div><img src="/wp-content/uploads/CS_images/icon-quote.gif"> SureshD:</div><div>

    Hello,


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


    <BLOCKQUOTE>

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

    </BLOCKQUOTE>

    Thanks


    </div></BLOCKQUOTE>


     


    that gives me error but i try that and worked nice

    <FONT size=2>

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


    that code deleted the active row

    </FONT>
  • 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