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

    <p>How can I add 20 rows to a spread sheet?</p><p> </p><p> Public gridGages As New FarPoint.Win.Spread.FpSpread</p><p> Public Sub AddOrDeleteRowsInPartFile()<br>        Dim intMaxRows As Integer<br>        intMaxRows = gridGages.ActiveSheet.RowCount<br><br><br>        gridGages.ActiveSheet.RowCount = 20<br>        Dim intRow As Integer<br><br>        For intRow = intMaxRows + 1 To gridGages.ActiveSheet.RowCount<br>            'Fills Characteristic Column<br>            gridGages.ActiveSheet.SetText(intRow - 1, 1, intRow)<br>            gridGages.ActiveSheet.SetActiveCell(intRow - 1, 0)<br>            gridGages.Update()<br><br>        Next<br><br>        gridGages.ActiveSheet.SetActiveCell(0, 0)<br><br>    End Sub <br></p><p> </p>
  • Replied 8 September 2017, 2:28 pm EST

    <P>The following code works for me. First I get a reference to the DefaultSheetDataModel dsdm, then I add 20 rows.</P><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P>FarPoint.Win.Spread.Model.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>DefaultSheetDataModel</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> dsdm = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>new</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> FarPoint.Win.Spread.Model.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>DefaultSheetDataModel</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>();</P>
    <P>fpSpread1.ActiveSheet.Models.Data = dsdm;</P></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P>dsdm.AddRows(fpSpread1.ActiveSheet.RowCount, 20);</FONT></FONT><BR></P>
Need extra support?

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

Learn More

Forum Channels