C# red cross in datagridview

前端 未结 2 596
-上瘾入骨i
-上瘾入骨i 2021-01-15 04:38

i am using c# and when i try to fill my datagridView most of the time a big red cross apears.

i searched for this and people say that you have to add



        
相关标签:
2条回答
  • 2021-01-15 05:15

    In YourForm.Designer.cs look for string gridView = new DataGridView() and replace it with

    gridView = new SafeDataGridView()

    private SafeDataGridView portos_online;

    portos_online = new SafeDataGridView();

    I hope this will solve your problem. Have a nice day!

    0 讨论(0)
  • 2021-01-15 05:15

    Same question here. Use Invoke method

    if (gridView.InvokeRequired)
        gridView.Invoke(new MethodInvoker(() => gridView.DataSource = YOUR_DATASOURCE));
    else
        gridView.DataSource = YOUR_DATASOURCE;
    
    0 讨论(0)
提交回复
热议问题