GridView: reentrant call to the SetCurrentCellAddressCore function RRS feed

  • Question

  • Simplified Architecture of my Porgram:

    2 Forms:
    - MainForm
    - DetailForm

    2 Threads:
    - Main Thread which runs the MainForm //Application.Run(MainForm)
    - Telegram Thread //receiving Socket Data for visualization

    Telegram Thread receives frequently (2s) socket data which forces the
    Main Thread via Callback 'Visualization' to refresh the Data in
    the GridView. Within the Callback function 'Visualization' the
    Telegram Thread could return immediately, doing his job, by calling
    this.Invoke(new VisualDelegate(MainFormVisual)).
    'MainFormVisual' wires up the GridView.DataSource with a DataTable,
    which is stored offline in memory, as shown in the following lines

    1.  gvMyGridView.DataSource = null;
    2.  gvMyGridView.DataSource = BuildActData(); //returning a DataTable

    After a undifined and non reproduceable timespan (approx. 20 min)
    repating this scenario, the following Exception will be thrown at line 1:
    EXCEPTION: Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function. 

    Tuesday, June 28, 2005 1:49 PM