Article View: borland.public.delphi.database.dotnet
Article #560Datatable refresh with new datatable
From: Bob
Date: Thu, 06 Jan 2005 03:50
Date: Thu, 06 Jan 2005 03:50
23 lines
1596 bytes
1596 bytes
(sorry about this cross post, but original was in wrong group) I have a datagrid that I populate with a datatable. But, if I change the data in the datatable, the grid seems to just add the new columns to the display rather than "clearing" and updating with the new table data in the datatable. Basically: Fill(dataTable) // fill with query 1 dataGrid.DataSource:= dataTable dataTable.Close Fill(dataTable) // fill table with query 2 dataGrid.Datasource:= dataTable The end result, has all the columns for query 1 and query 2 displayed. The query 1 columns are all "nil" of course but they are still shown. Is there a way to "Clear" the datagrid completely before assigning a new datasource? I have tried, dataTable.ResetBindings hoping that would work but it didn't
Technical Details
Message-ID:
<41dcb587$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,957c64a5b6bd6a51,start X-Google-Attributes: gid1effe6,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Bob" <rcf2@email.com> Subject: Datatable refresh with new datatable Newsgroups: borland.public.delphi.database.dotnet User-Agent: XanaNews/1.17.1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 208.45.225.186 Message-ID: <41dcb587$1@newsgroups.borland.com> Date: 5 Jan 2005 19:50:31 -0800 X-Trace: newsgroups.borland.com 1104983431 208.45.225.186 (5 Jan 2005 19:50:31 -0800) Lines: 23 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail