Crash on bound sheet

Posted by: crmfusiongw on 8 September 2017, 3:00 pm EST

  • Posted 8 September 2017, 3:00 pm EST

    I have a bound sheet and I'm updating data in the sheet.  I then go to reset the sheet and get the following error:

    Message=Controls created on one thread cannot be parented to a control on a different thread. ParamName=null Data=... InnerException={ } TargetSite={ } StackTrace=   at System.Windows.Forms.Control.ControlCollection.Add(Control value)

       at FarPoint.Win.Spread.SpreadView.g(Boolean A_0)

       at FarPoint.Win.Spread.SpreadView.set_HorizontalScrollBar(SpreadHScrollBar value)

       at FarPoint.Win.Spread.SpreadView.d(Boolean A_0)

       at FarPoint.Win.Spread.FpSpread.d(Boolean A_0)

       at FarPoint.Win.Spread.FpSpread.Reset()

     

    Is there a way I can test the sheet object to test if it is busy?  Is there a patch for this bug (I'm on  6.0.3505.2008)

    GlennW 

  • Replied 8 September 2017, 3:00 pm EST

    Hi Glenn,

    Can you post a small sample showing this problem?  I'm not seeing the connection between Reset and the exception coming from ControlCollection.Add.

    Are you calling into a Spread control that was created in another thread?  You can check the FpSpread.InvokeRequired property to see if that's the case.  If it's true then you should use a delegate and FpSpread.Invoke to call the Reset method (and any other calls you make to that Spread too).

  • Replied 8 September 2017, 3:00 pm EST

    The spread is not created on a separate thread but there could be modifications on the dataset that were called in new threads.

     

    Could you provide a more detailed explanation of use a delegate to call the .Invoke call?  I've never used that before.

     GlennW 

  • Replied 8 September 2017, 3:00 pm EST

    Hello,

    I would request you to provide me a sample application depicting your issue so that I can replicate the issue at my end and debug it further.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:00 pm EST

    Hi Glenn,

    Could you provide a more detailed explanation of use a delegate to call the .Invoke call?  I've never used that before.

    Sure, here is a good quick tutorial about delegates and how to use them to call code: Delegates Tutorial.

     

     

Need extra support?

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

Learn More

Forum Channels