DataGrid class (System.Windows.Forms)

S

Sanddevil

Hi there - I hope someone out there can help me! I'm using a .Net DataGrid
Class to show the results of a SQL query in a spreadsheet type control. The
code, which works fine is:

iRowCount = oleDbDataAdapter1->Fill(dataSet1);

dataGrid1->DataSource = dataSet1->Tables->Item[0]->DefaultView;



I then update the underlying data in the database elsewhere in the code and
want the datagrid control to show the updated rows correctly. I do a refresh
to ensure the dataSet is up-to-date with the following statement:

iRowCount = oleDbDataAdapter1->Fill(dataSet1);

and having checked the iRowCount value I know that the dataSet has
definitely got the new row.

So, the question is, how do I get the DataGrid to show the updated data on
the screen? There doesn't appear to be a Reload / Rebind type method in the
System.Windows.Forms.DataGrid Class. The Refresh() method doesn't do it. Any
help will be most appreciated!



Cheers
 
I

Ioannis Vranos

Sanddevil said:
Hi there - I hope someone out there can help me! I'm using a .Net DataGrid
Class to show the results of a SQL query in a spreadsheet type control. The
code, which works fine is:

iRowCount = oleDbDataAdapter1->Fill(dataSet1);

dataGrid1->DataSource = dataSet1->Tables->Item[0]->DefaultView;



I then update the underlying data in the database elsewhere in the code and
want the datagrid control to show the updated rows correctly. I do a refresh
to ensure the dataSet is up-to-date with the following statement:

iRowCount = oleDbDataAdapter1->Fill(dataSet1);

and having checked the iRowCount value I know that the dataSet has
definitely got the new row.

So, the question is, how do I get the DataGrid to show the updated data on
the screen? There doesn't appear to be a Reload / Rebind type method in the
System.Windows.Forms.DataGrid Class. The Refresh() method doesn't do it. Any
help will be most appreciated!


This is off topic here.


Try microsoft.public.dotnet.languages.vc newsgroup.


Also better use the public MS news server for that one:

msnews.microsoft.com
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top