Unbinding a datagridview

Hi,

i'm using an ado classic recordset to populate a datagridview in VS2005, and once poulated want to treat it as an 'unbound' grid so i can add my own rows, however when i do try to add new rows i get a message saying i cant add to a bound grid. when i try to remove the binding as below, all the data disappears !!!.

I must be missing something simple but i have tried all sorts without any luck.

below is an extract of my code, please help, its driving me nuts lol.

Many thanks in advance

Bob

Dim DataAdapter As New System.Data.OleDb.OleDbDataAdapter

Dim DataTable As New DataTable

JBCSET.Open("SELECT * FROM JobJbc", ADOCNN, adOpenDynamic, adLockOptimistic)

DataAdapter.Fill(DataTable, JBCSET)

DgvJbc.DataSource = DataTable ' fills the grid OK

DgvJbc.DataBindings.Clear() ' seems to do nothing

DgvJbc.DataSource = Nothing ' ZAPS the contents of the grid



Answer this question

Unbinding a datagridview