Changing Datasource for Datagrid

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!
 
G

Guest

Try setting your datagris to nothing before binding to the new dataset.

DataGrid1.DataSource = Nothing

B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top