Default Font and Row Height

Posted by: d2.autoservicio on 21 January 2025, 11:22 am EST

    • Post Options:
    • Link

    Posted 21 January 2025, 11:22 am EST

    In Visual Basic, I usually reset back to 0 the row count and add dynamically based on the dataset or information, same with column count.

    I’ve set the Font Property of the spread to a specific Font and size, but when adding rows, these have Calibri Font and the row height is changed.

    How can I have a default Font and Row Height for new rows or columns?

    Using Spread.Net V18.0.20241.0

  • Posted 26 January 2025, 1:43 pm EST

    Hi,

    You can handle FpSpread’s RowChanged event to set the font of the dynamically added cells. Here is the code snippet for the same:

    Private Sub FpSpread_RowChanged(sender As Object, e As SheetViewEventArgs)
        FpSpread1_Sheet1.Cells(0, 0, FpSpread1.ActiveSheet.RowCount - 1, FpSpread1.ActiveSheet.ColumnCount - 1).Font = New Font("Arial", 35, FontStyle.Bold)
    End Sub

    Kindly refer to the attached sample for full implementation. See RowAddVB.zip.

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels