CellNote Click event

Posted by: shinsid on 8 September 2017, 3:23 pm EST

  • Posted 8 September 2017, 3:23 pm EST

    Is there any event to identify mouse click on Cell Note ?

    I want to open pop up for cell note only if the cell note indicator is clicked.
  • Marked as Answer

    Replied 8 September 2017, 3:23 pm EST

    Hi,

    If you want to make the cell note in the cell toggle between NoteStyle.PopupNote and NoteStyle.StickyNote when the user clicks in the note indicator in the cell, you can do that with this code using the MouseDown event:
    private void fpSpread1_MouseDown(object sender, MouseEventArgs e)
    {
    FarPoint.Win.Spread.HitTestInformation hti = fpSpread1.HitTest(e.X, e.Y);
    if (hti.Type == FarPoint.Win.Spread.HitTestType.Viewport && fpSpread1.ActiveSheet.GetNote(hti.ViewportInfo.Row, hti.ViewportInfo.Column) != null)
    {
    Rectangle rect = fpSpread1.GetCellRectangle(fpSpread1.GetActiveRowViewportIndex(), fpSpread1.GetActiveColumnViewportIndex(), hti.ViewportInfo.Row, hti.ViewportInfo.Column);
    Rectangle noteIndicator = new Rectangle(rect.Right - 5, rect.Top, 5, 5);
    if (noteIndicator.Contains(e.X, e.Y))
    {
    if(fpSpread1.ActiveSheet.Cells[hti.ViewportInfo.Row, hti.ViewportInfo.Column].NoteStyle == FarPoint.Win.Spread.NoteStyle.PopupNote)
    fpSpread1.ActiveSheet.Cells[0, 0].NoteStyle = FarPoint.Win.Spread.NoteStyle.StickyNote;
    else
    fpSpread1.ActiveSheet.Cells[0, 0].NoteStyle = FarPoint.Win.Spread.NoteStyle.PopupNote;
    }
    }
    }

    Regards,
    -Sean
Need extra support?

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

Learn More

Forum Channels