Clearing of notes and othe properties.

Posted by: arunkumar on 8 September 2017, 2:16 pm EST

  • Posted 8 September 2017, 2:16 pm EST

    Hi,


    I have different sheets in a spread. i am setting some properties like note on column in one sheet,if i am moving to another sheet how to reset all the properties set in previous one to default properties.


    Can anyone help me in this issue.


    Thanks in advance, 


     

  • Replied 8 September 2017, 2:16 pm EST

    Arun,


    Note is a cell level property not a column level. You can use the ActivesheetChanging event to reset the cell note to empty string to reset it for the column. Below snippet illustrates the same:


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    FpSpread1.Sheets.Count = 2


    FpSpread1.Sheets(0).AllowNoteEdit = True


    For i As Integer = 0 To FpSpread1.Sheets(0).RowCount - 1


    FpSpread1.Sheets(0).Cells(i, 1).Note = "test"


    FpSpread1.Sheets(0).Cells(i, 1).NoteIndicatorColor = Color.Green


    FpSpread1.Sheets(0).Cells(i, 1).NoteStyle = FarPoint.Win.Spread.NoteStyle.StickyNote


    Next


    End Sub


    Private Sub FpSpread1_ActiveSheetChanging(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.ActiveSheetChangingEventArgs) Handles FpSpread1.ActiveSheetChanging


    For i As Integer = 0 To FpSpread1.Sheets(0).RowCount - 1


    FpSpread1.Sheets(0).Cells(i, 1).Note = " "


    Next


    End Sub

  • Replied 8 September 2017, 2:16 pm EST

    Arun,


    In addition to the above, you can also use the ResetNote method of Spread in the ActiveSheetChanging event as follws. The RestNote method, resets the note for the cell to empty:


    Private Sub FpSpread1_ActiveSheetChanging(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.ActiveSheetChangingEventArgs) Handles FpSpread1.ActiveSheetChanging


    For i As Integer = 0 To FpSpread1.Sheets(0).RowCount - 1


    FpSpread1.Sheets(0).Cells(i, 1).ResetNote()


    Next


    End Sub

Need extra support?

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

Learn More

Forum Channels