468,290 Members | 1,906 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,290 developers. It's quick & easy.

datagridview refresh

M K
I have added a record to the underlying db and after I add the record i do a
datagridview.Refresh(); and i dont see the newly added record.

If i stop and start the application its there. What am I doing or not
doing?

Mark
Jul 10 '07 #1
3 27446
datagridview.Refresh() redraws the grid-view from the data source
(presumably a DataSet in your case); it doesn't reload the DataSet
from the database. You may have to Clear() and Fill() the DataTable
(or DataSet).

Marc

Jul 11 '07 #2
M K
I found the .Clear() method but not the .Fill() method on the dataset.

I have the following:
Dataset
BindingSource
TableAdapter

"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.com...
datagridview.Refresh() redraws the grid-view from the data source
(presumably a DataSet in your case); it doesn't reload the DataSet
from the database. You may have to Clear() and Fill() the DataTable
(or DataSet).

Marc

Jul 11 '07 #3
M K
uggg i finally figured it out..

DataSet1.GetChanges();

TableAdapter.Fill(DataSet1.table);

thanks for pointing me in the right direction :)

"M K" <sk********************@yahoo.comwrote in message
news:%J*****************@newsread3.news.pas.earthl ink.net...
>I found the .Clear() method but not the .Fill() method on the dataset.

I have the following:
Dataset
BindingSource
TableAdapter

"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.com...
>datagridview.Refresh() redraws the grid-view from the data source
(presumably a DataSet in your case); it doesn't reload the DataSet
from the database. You may have to Clear() and Fill() the DataTable
(or DataSet).

Marc


Jul 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by RSH | last post: by
6 posts views Thread by George | last post: by
2 posts views Thread by Rick Shaw | last post: by
3 posts views Thread by David Cartwright | last post: by
3 posts views Thread by Richard Lewis Haggard | last post: by
3 posts views Thread by aleesha | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.