Upgrade from V3 to V4: ClipboardPaste will not fire CellChanged anymore

Posted by: mehmet on 8 September 2017, 1:08 pm EST

  • Posted 8 September 2017, 1:08 pm EST

    Hello,


    after the upgrade from Version 3 to Version 4 of Farpoint Spread calling Spread.ActiveSheet.ClipBoardPaste() is not firing a SheetView.CellChanged event anymore.


    Any hints?


     


    Thank you in advance,


    Mehmet


     

  • Replied 8 September 2017, 1:08 pm EST

    Ok, I've uploaded a sample project using  MyGeneralCellType derived from GeneralCellType. Note that in this class nothing is overridden.


     


    2008/04/WindowsApplication2.zip
  • Replied 8 September 2017, 1:08 pm EST

    Mehmet -

    The issue is not with the event not getting called.  The issue is that the ClipboardPaste isn't pasting data into the cells so there's no reason for the event to be called.  I am not sure why that is happening.  I will see if I can find the reason and I'll let you know what I find out.
  • Replied 8 September 2017, 1:08 pm EST

    Thank you, Bob
  • Replied 8 September 2017, 1:08 pm EST

    Mehmet -

    The event is firing so I suspect the issue is one with your code and the dialogbox interrupting with the clipboard.  I've attached your project with some modifications.  Run the project and type some data in first cell.  Then highlight the data and do a CTRL-C.  Click on the second cell in Column B and click button 2.

    2008/04/Mehmet.zip
  • Replied 8 September 2017, 1:08 pm EST

    Mehmet -

    It is firing in my test.  Which overload of the ClipBoardPaste are you using?
  • Replied 8 September 2017, 1:08 pm EST

    Hi Bob,


    I'm using a Style (set in StyleInfo.Type) derived from GeneralCellType. If I use GeneralCellType directly, the event is fired.


     


     

  • Replied 8 September 2017, 1:08 pm EST

    Could you post a small project reproducing this for us to debug?
  • Replied 8 September 2017, 1:08 pm EST

    Bob,


    your example is not working, but a collegue of mine has found an answer for this problem:


    Since Clipboard-Copy puts a MemoryStream into the clipboard, the content of a cell is serialized. So when deriving from GeneralCellType, you have to put the [Serializable] attribute above the class and provide a standard-constructor AND a serializable-constructor:


     


    [Serializable]


    public class MyGeneralCellType : GeneralCellType


    {


    public MyGeneralCellType()


    { }


    public MyGeneralCellType(SerializationInfo info, StreamingContext context): base(info, context)


    {


    }

Need extra support?

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

Learn More

Forum Channels