I am seting a datasource of a dataGridview to a table.
First In Load Event
Datagridview.datasource=DTFromSQl
In some Random Event I do.
Dim Dt as datatable=DataGridview1.datasource
When I do DT.rows.clear() it also clears the rows in the Datagridview. I suppose its due to databinding. But how is the databind occuring? and how to remove it so that changes in DT occurs in it only.
Thanks
Ok I did it but, something doesnt feel right about it.
Dim DTSend As New DataTable
For i As Integer = 0 To DataGridView1.ColumnCount - 1
DTSend.Columns.Add(DataGridView1.Columns(i).Name)
Next
Use the following code. when you will clear the
datatableit will not clear yourdatagridview