DataGridView.Clear()

前端 未结 19 1884
夕颜
夕颜 2020-12-02 20:01

Here comes the trouble. I want to delete all rows from datagridview. This how i add rows:

private void ReadCompleteCallback(object clientHandle, Opc.Da.ItemV         


        
19条回答
  •  渐次进展
    2020-12-02 20:41

    Basically below code line is only useful in data binding scenarios

    datagridview.DataSource = null; 
    

    otherwise below is the used when no data binding and datagridview is populated manually

    dataGridView1.Rows.Clear();
    dataGridView1.Refresh();
    

    So, check first what you are doing.

提交回复
热议问题