500 Internal Server Error again

Posted by: kbj on 26 September 2018, 4:31 pm EST

    • Post Options:
    • Link

    Posted 26 September 2018, 4:31 pm EST

    Why do I get this error when I post example code?

  • Posted 26 September 2018, 4:32 pm EST

    example :

    Public Class Form1

    'custom models.data wipes out sheetview.defaultStyle.celltype

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load

    FpSpread1.ActiveSheet.DefaultStyle.CellType = New NumberCellType

    FpSpread1.ActiveSheet.Models.Data = New myModelsData

    checkit()

    FpSpread1.ActiveSheet.DefaultStyle.CellType = New NumberCellType

    FpSpread1.ActiveSheet.Models.Data = New DefaultSheetDataModel

    checkit()

    End Sub

    Private Sub checkit()

    If FpSpread1.ActiveSheet.DefaultStyle.CellType Is Nothing Then

    Debug.Print(“DefaultStyle.CellType is NOTHING”)

    Else

    Debug.Print(“DefaultStyle.CellType is something”)

    End If

    End Sub

    End Class

    Public Class myModelsData

    Inherits DefaultSheetDataModel

    End Class

  • Posted 26 September 2018, 4:33 pm EST

    Imports FarPoint.Win.Spread.CellType

    Imports FarPoint.Win.Spread.Model

    Public Class Form1

    'custom models.data wipes out sheetview.defaultStyle.celltype

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load

    FpSpread1.ActiveSheet.DefaultStyle.CellType = New NumberCellType

    FpSpread1.ActiveSheet.Models.Data = New myModelsData

    checkit()

    FpSpread1.ActiveSheet.DefaultStyle.CellType = New NumberCellType

    FpSpread1.ActiveSheet.Models.Data = New DefaultSheetDataModel

    checkit()

    End Sub

    Private Sub checkit()

    If FpSpread1.ActiveSheet.DefaultStyle.CellType Is Nothing Then

    Debug.Print(“DefaultStyle.CellType is NOTHING”)

    Else

    Debug.Print(“DefaultStyle.CellType is something”)

    End If

    End Sub

    End Class

    Public Class myModelsData

    Inherits DefaultSheetDataModel

    End Class

  • Posted 26 September 2018, 4:35 pm EST

    please run the above code and see why:

    custom models.data wipes out sheetview.defaultStyle.celltype

    thanks,

    Kingman

  • Posted 27 September 2018, 5:56 am EST

    Hello,

    The DefaultSheetDataModel will overwrite the settings you have made to data model previously. I would suggest you to set the CellType for DefaultStyle after you set the data model for sheet.

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels