How can I auto assign the new row a define style?

Posted by: bashman on 8 September 2017, 12:56 pm EST

  • Posted 8 September 2017, 12:56 pm EST

    the spread's datasource is a dataSet, and there are 3 related dataTables under the dataSet, when I dynamic add a row to anyone dataTable, the spread will auto display new add result, but, the format is also default , How can I assign a define style the new add data?

    It's my code:


     <SPAN class=kwd>Private</SPAN> model <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.Model.DefaultSheetDataModel

    model = spread1.ActiveSheet.Models.Data

    model.DataMember = <SPAN class=st>"MarketTable"</SPAN>
    <SPAN class=kwd>Dim</SPAN> ds <SPAN class=kwd>As</SPAN> DataSet = m_dataSetGroup(sSelectTabName)
    model.DataSource = ds
      'another one to add new data to datasource
     ds.Tables(<SPAN class=st>"Table2"</SPAN>).Rows.Add(<SPAN class=kwd>New Object</SPAN>() {<SPAN class=st>"test"</SPAN>,1,2,<SPAN class=st>"test2"</SPAN>})
    ds.Tables(<SPAN class=st>"Table2"</SPAN>).AcceptChanges()
  • Replied 8 September 2017, 12:56 pm EST


    If you assign your style to the Column objects, then the style for that column will apply automatically to the new row when it is added. If you apply the style to the AlternatingRows, the same holds true. If you are applying the style to each Row object or individual cells, you would need to add the style to the new row after adding the row to the bound DataTable.

Need extra support?

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

Learn More

Forum Channels