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:


     

     Private model As FarPoint.Win.Spread.Model.DefaultSheetDataModel

    model = spread1.ActiveSheet.Models.Data

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

    Hello,


    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