Row count Problem in spread sheet

Posted by: stylish16 on 8 September 2017, 2:52 pm EST

  • Posted 8 September 2017, 2:52 pm EST

    Hi,

    I have made a spreadsheet in which i have taken 50 rows by setting row count property from designer & populating this rows from table in DB.

    But, In case in future, rows added in Table are greater than 50, then how can i add more rows.

    I think by increasing row count again through designer is not a good way.

    I am also inserting new rows in DB from this sheet.

    What will happen in a scenario like i want to add new row in db but rows are already full in spread sheet?

    How can i generate row automatically through code? Provide me some code for doing this.

    Suggest me proper way through if rows are full.

    Thanks in advance.

     

  • Replied 8 September 2017, 2:52 pm EST

    Sounds like you want to add unbound rows

    <table id="pagetoptable1">
    <tr id="pagetoptable1row2">
    <td colSpan="2" align="left"><span id="pagetitle">AddUnboundRows Method
    </span></td></tr>
    <tr id="pagetoptable1row3">
    <td colSpan="2">See Also Example <span id="feedbacklink"></span></td></tr></table><table id="pagetopbreadcrumbs" cellSpacing="0" cellPadding="0">

    <tr>
    <td>FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model
    Namespace
    > DefaultSheetDataModel
    Class
    : AddUnboundRows Method</td></tr></table><div style="visibility:hidden;" id="dxlanguagemenu" class="dxpopupbubble"> Visual Basic
    (Declaration)
    Visual Basic (Usage)
    C# </div><div style="visibility:hidden;" id="row_box" class="dxpopupbubble">

    <i>row</i>
    Row index at which to add the new rows</div><div style="visibility:hidden;" id="count_box" class="dxpopupbubble">

    <i>count</i>
    Number of rows to add</div><div style="top:0px;height:874px;overflow:auto;" id="pagebody">
    <div id="mainbody">
    <div id="allHistory" class="saveHistory"></div>Adds unbound rows to the data model.
    <h1 class="heading"><span class="expandcollapse"><img id="syntaxToggle" class="toggle" src="http://www.clubfarpoint.com/Forums/forums/dotnetimages/collapse.gif">Syntax</span></h1>
    <div id="syntaxSection" class="section">
    <div style="display:block;" id="Syntax_VB" class="LanguageSpecific">
    <table class="syntaxtable" cellSpacing="0" cellPadding="0">

    <tr>
    <th>Visual Basic (Declaration)</th>
    <th> </th></tr>
    <tr>
    <td colSpan="2">
    Public Sub AddUnboundRows( _
    ByVal <i>row</i> As Integer, _
    ByVal <i>count</i> As Integer _
    ) </pre></td></tr></table></div>
    <div style="display:block;" id="Syntax_VBUsage" class="LanguageSpecific">
    <table class="syntaxtable" cellSpacing="0" cellPadding="0">

    <tr>
    <th>Visual Basic (Usage)</th>
    <th><span class="copyCode"><img class="copyCodeImage" align="absMiddle" src="http://www.clubfarpoint.com/Forums/forums/dotnetimages/copycode.gif">Copy Code</span></th></tr>
    <tr>
    <td colSpan="2"><pre><code>Dim instance As DefaultSheetDataModel
    Dim row As Integer
    Dim count As Integer

    instance.AddUnboundRows(row, count)</code></pre></td></tr></table></div>
    <div style="display:block;" id="Syntax_CS" class="LanguageSpecific">
    <table class="syntaxtable" cellSpacing="0" cellPadding="0">

    <tr>
    <th>C#</th>
    <th> </th></tr>
    <tr>
    <td colSpan="2"><pre>public void AddUnboundRows(
    int <i>row</i>,
    int <i>count</i>
    )</pre></td></tr></table></div>
    <h4 class="dxh4">Parameters</h4>

    <i>row</i>
    Row index at which to add the new rows
    <i>count</i>
    Number of rows to add</div>
    <h1 class="heading"><span class="expandcollapse"><img id="exampleToggle" class="toggle" src="http://www.clubfarpoint.com/Forums/forums/dotnetimages/collapse.gif">Example</span></h1>
    <div id="exampleSection" class="section">This example
    adds unbound rows to the data model.
    <div style="display:block;" id="Example_CS" class="LanguageSpecific">
    <table class="syntaxtable" cellSpacing="0" cellPadding="0">

    <tr>
    <th>C#</th>
    <th><span class="copyCode"><img class="copyCodeImage" align="absMiddle" src="http://www.clubfarpoint.com/Forums/forums/dotnetimages/copycode.gif">Copy Code</span></th></tr>
    <tr>
    <td colSpan="2"><code class="CS">FarPoint.Win.Spread.Model.DefaultSheetDataModel
    dataModel = <font color="blue">new</font> <font color="black">FarPoint.Win.Spread.Model.DefaultSheetDataModel(5,
    5);
    dataModel.AddCustomName(</font><font color="#a31515">"TWICESUM"</font><font color="black">,</font> <font color="#a31515">"2*SUM(A1,A2)"</font><font color="black">, 1, 1);
    dataModel.SetFormula(1, 1,</font> <font color="#a31515">"TWICESUM"</font><font color="black">);
    dataModel.SetValue(0, 0,
    10);
    dataModel.SetValue(1, 0, 10);
    fpSpread1.ActiveSheet.Models.Data =
    dataModel;</font></code></td></tr></table></div>
    <div style="display:block;" id="Example_VB" class="LanguageSpecific">
    <table class="syntaxtable" cellSpacing="0" cellPadding="0">

    <tr>
    <th>Visual Basic</th>
    <th><span class="copyCode"><img class="copyCodeImage" align="absMiddle" src="http://www.clubfarpoint.com/Forums/forums/dotnetimages/copycode.gif">Copy Code</span></th></tr>
    <tr>
    <td colSpan="2"><code class="VB"><font class="keyword">Dim</font> ds <font class="keyword">As</font> <font class="keyword">New</font> DataSet()
    <font class="keyword">Dim</font> emp <font class="keyword">As</font> <font class="keyword">New</font> DataTable(<font class="string">"Employees"</font>)
    <font class="keyword">Dim</font> div <font class="keyword">As</font> <font class="keyword">New</font> DataTable(<font class="string">"Division"</font>)
    emp.Columns.Add(<font class="string">"LastName"</font>)
    emp.Columns.Add(<font class="string">"FirstName"</font>)
    emp.Rows.Add(<font class="keyword">New</font>
    <font class="keyword">Object</font>() {<font class="string">"Jones"</font>, <font class="string">"Marianne"</font>})
    emp.Rows.Add(<font class="keyword">New</font>
    <font class="keyword">Object</font>() {<font class="string">"Fieldes"</font>, <font class="string">"Anna"</font>})
    div.Columns.Add(<font class="string">"Section"</font>)
    div.Columns.Add(<font class="string">"Specialty"</font>)
    div.Rows.Add(<font class="keyword">New</font>
    <font class="keyword">Object</font>() {<font class="string">"Finance"</font>, <font class="string">"Taxes"</font>})
    div.Rows.Add(<font class="keyword">New</font>
    <font class="keyword">Object</font>() {<font class="string">"Mergers"</font>, <font class="string">"Legal"</font>})
    ds.Tables.AddRange(<font class="keyword">New</font> DataTable() {emp, div})
    <font class="keyword">Dim</font> dataModel <font class="keyword">As</font> <font class="keyword">New</font>
    FarPoint.Win.Spread.Model.DefaultSheetDataModel()
    dataModel.DataSource =
    ds
    dataModel.DataMember = <font class="string">"Division"</font>
    dataModel.AddUnboundRows(1,
    3)
    FpSpread1.ActiveSheet.Models.Data =
    dataModel</code></td></tr></table></div></div>
    <h1 class="heading"><span class="expandcollapse"><img id="seealsoToggle" class="toggle" src="http://www.clubfarpoint.com/Forums/forums/dotnetimages/collapse.gif">See
    Also</span></h1>
    <div id="seealsoSection" class="section">
    <h4 class="dxh4">Reference</h4>DefaultSheetDataModel
    Class

    DefaultSheetDataModel
    Members

    </div></div>
    <div id="pagefooter">


    <hr>

    <p>© 2002-2011 GrapeCity, Inc. All rights reserved. Send
    Feedback

    </div></div>
Need extra support?

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

Learn More

Forum Channels