PC Review


Reply
Thread Tools Rate Thread

Changing Datasource for Datagrid

 
 
Georg Schmelzer
Guest
Posts: n/a
 
      13th Aug 2004
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!



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJpYW5ESA==?=
Guest
Posts: n/a
 
      13th Aug 2004
Try setting your datagris to nothing before binding to the new dataset.

DataGrid1.DataSource = Nothing

B

"Georg Schmelzer" wrote:

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

 
Reply With Quote
 
Georg Schmelzer
Guest
Posts: n/a
 
      13th Aug 2004
Thanks, but I tried that one already, doesn't work. Any other ideas?


"BrianDH" <(E-Mail Removed)> schrieb im Newsbeitrag
news:718625DB-2258-4772-8943-(E-Mail Removed)...
> Try setting your datagris to nothing before binding to the new dataset.
>
> DataGrid1.DataSource = Nothing
>
> B
>
> "Georg Schmelzer" wrote:
>
> > 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!
> >
> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid X DataSource Brahm Microsoft VB .NET 2 28th Jun 2006 05:38 PM
DataGrid with a table style does not refresh properly when changing the datasource Shawn Benson Microsoft C# .NET 1 3rd Oct 2005 05:51 PM
How do you map DataGrid rows to it's DataSource when sorting a DataGrid? aualias Microsoft Dot NET Framework Forms 2 13th Sep 2005 06:09 PM
DataGrid ItemStyle is a textbox and doesn't update the datagrid datasource matthew schouppe Microsoft ASP .NET 3 30th Apr 2004 04:02 PM
cast datagrid.datasource to dataset (datasource is table) newsgroper@yahoo.com Microsoft Dot NET Framework Forms 1 4th Jul 2003 04:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:22 PM.