Changing Datasource for Datagrid

  • Thread starter Thread starter Georg Schmelzer
  • Start date Start date
G

Georg Schmelzer

Hi Ng,

I've got the following Problem:
There is a windows form with one Datagrid. I set the datasource at runtime
either to a at runtime designed datatable with for Columns, or to a also at
runtime designed datatable with 3 columns.

It works fine, at the first try. But when I change the datasource from 3
columns datatable to 4 columns datatable only one column (the first) appears
in the datagrid. I get the same result when i do it from 4 to 3 columns.

Any Ideas?

Thanks in Advance!
 
Try setting your datagris to nothing before binding to the new dataset.

DataGrid1.DataSource = Nothing

B
 
Back
Top