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
try:
datagrid.DataSource = null;
datagrid.DataBind();
Basically you will need to clear the datasource your binding to the grid.
Try this Method
dataGridView1.DataSource = dt;
dt.Rows.Clear();
This is one way of doing it:
datagridview.DataSource = null;
datagridview.Refresh();
I hope it works for you because it is working for me.
Set the datasource property to an empty string then call the Clear method.
To clear the datagridview
write the following code:
dataGridView1.DataSource=null;
I know it sounds crazy, but I solved this issue by changing the datagrid.visible property to false and then to true. It causes a very small blink, but it works for me (at least for now).