none
About an exception Cross-thread operation not valid: Control 'GridContorl' accessed from a thread other than the thread it was created on RRS feed

  • Question

  • Hi

    I unable to handle this exception.

    I am just throwing this error.

    when ever application hits that particular code it throws the exception and execute further, is it a problem in deploying the application.

    If so after deploying the application is it gives any problem or it struck in the middle

    My application  is windows application.

    Please give me any suggestion.

     

    Monday, January 10, 2011 9:03 PM

Answers

  • Control 'GridContorl' accessed from a thread other than the thread it was created on

    That should tell you where you need to look. Windows Forms controls are not thread-safe, you should not access them directly in a background thread. Control.Invoke is invented for this purpose.

    If you need more help in Windows Forms, visit the forums under the Windows Forms category. Debugging can only help you find where the problem is.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by tsk238 Tuesday, January 11, 2011 4:21 AM
    Monday, January 10, 2011 10:29 PM