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

    <P>Hi,</P>
    <P>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.</P>
    <P>Can anyone help me in this issue.</P>
    <P>Thanks in advance, </P>
    <P> </P>
  • Replied 8 September 2017, 2:16 pm EST

    <P>Arun,</P>
    <P>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:</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
    <P>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</P>
    <P>FpSpread1.Sheets.Count = 2</P>
    <P>FpSpread1.Sheets(0).AllowNoteEdit = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True</P></FONT></FONT><FONT size=2>
    <P></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</P>
    <P>FpSpread1.Sheets(0).Cells(i, 1).Note = </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"test"</P></FONT></FONT><FONT size=2>
    <P>FpSpread1.Sheets(0).Cells(i, 1).NoteIndicatorColor = Color.Green</P>
    <P>FpSpread1.Sheets(0).Cells(i, 1).NoteStyle = FarPoint.Win.Spread.NoteStyle.StickyNote</P>
    <P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Next</P></FONT></FONT><FONT size=2>
    <P></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></P><FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
    <P>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></P>
    <P></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</P>
    <P>FpSpread1.Sheets(0).Cells(i, 1).Note = </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>" "</P></FONT></FONT><FONT size=2>
    <P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Next</P></FONT></FONT><FONT size=2>
    <P></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</P></FONT></FONT></FONT></FONT>
  • Replied 8 September 2017, 2:16 pm EST

    <P>Arun,</P>
    <P>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:</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
    <P>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</P>
    <P></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</P>
    <P>FpSpread1.Sheets(0).Cells(i, 1).ResetNote()</P>
    <P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Next</P></FONT></FONT><FONT size=2>
    <P></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</P></FONT></FONT>
Need extra support?

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

Learn More

Forum Channels