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:

    <FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> Form1_Load(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> sender </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.Object, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> e </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.EventArgs) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Handles</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>MyBase</FONT></FONT><FONT size=2>.Load


    FpSpread1.Sheets.Count = 2


    FpSpread1.Sheets(0).AllowNoteEdit = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>For</FONT></FONT><FONT size=2> i </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Integer</FONT></FONT><FONT size=2> = 0 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>To</FONT></FONT><FONT size=2> FpSpread1.Sheets(0).RowCount - 1


    FpSpread1.Sheets(0).Cells(i, 1).Note = </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"test"

    </FONT></FONT><FONT size=2>

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


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


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Next

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT>

    <FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    Private</FONT></FONT><FONT color=#000000 size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT color=#000000 size=2> FpSpread1_ActiveSheetChanging(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT color=#000000 size=2> sender </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT color=#000000 size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Object</FONT></FONT><FONT color=#000000 size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT color=#000000 size=2> e </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT color=#000000 size=2> FarPoint.Win.Spread.ActiveSheetChangingEventArgs) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Handles</FONT></FONT><FONT size=2><FONT color=#000000> FpSpread1.ActiveSheetChanging</FONT>


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>For</FONT></FONT><FONT size=2> i </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Integer</FONT></FONT><FONT size=2> = 0 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>To</FONT></FONT><FONT size=2> FpSpread1.Sheets(0).RowCount - 1


    FpSpread1.Sheets(0).Cells(i, 1).Note = </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>" "

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Next

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub

    </FONT></FONT></FONT></FONT>
  • 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:

    <FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> FpSpread1_ActiveSheetChanging(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> sender </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Object</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> e </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> FarPoint.Win.Spread.ActiveSheetChangingEventArgs) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Handles</FONT></FONT><FONT size=2> FpSpread1.ActiveSheetChanging


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>For</FONT></FONT><FONT size=2> i </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Integer</FONT></FONT><FONT size=2> = 0 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>To</FONT></FONT><FONT size=2> FpSpread1.Sheets(0).RowCount - 1


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


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Next

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub

    </FONT></FONT>
Need extra support?

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

Learn More

Forum Channels