How to add rows in the FP Spread Sheet using VB.net 2005

Posted by: cmdolcet69 on 8 September 2017, 2:28 pm EST

  • Posted 8 September 2017, 2:28 pm EST

    How can I add 20 rows to a spread sheet?

     

     Public gridGages As New FarPoint.Win.Spread.FpSpread

     Public Sub AddOrDeleteRowsInPartFile()
            Dim intMaxRows As Integer
            intMaxRows = gridGages.ActiveSheet.RowCount


            gridGages.ActiveSheet.RowCount = 20
            Dim intRow As Integer

            For intRow = intMaxRows + 1 To gridGages.ActiveSheet.RowCount
                'Fills Characteristic Column
                gridGages.ActiveSheet.SetText(intRow - 1, 1, intRow)
                gridGages.ActiveSheet.SetActiveCell(intRow - 1, 0)
                gridGages.Update()

            Next

            gridGages.ActiveSheet.SetActiveCell(0, 0)

        End Sub

     

  • Replied 8 September 2017, 2:28 pm EST

    The following code works for me. First I get a reference to the DefaultSheetDataModel dsdm, then I add 20 rows.


    FarPoint.Win.Spread.Model.DefaultSheetDataModel dsdm = new FarPoint.Win.Spread.Model.DefaultSheetDataModel();


    fpSpread1.ActiveSheet.Models.Data = dsdm;


    dsdm.AddRows(fpSpread1.ActiveSheet.RowCount, 20);

Need extra support?

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

Learn More

Forum Channels