By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,156 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,156 IT Pros & Developers. It's quick & easy.

Refreshing DataGridView

P: n/a
I have Winforms DataGridView whose DataSource Rids is Marc sample
TableListCollection<TRowderived from BindingList.
It is used to edit invoice rows.
If user presses Revert button, my application reads original rows from
server database:

List<TRowtr;
tr = q.Where(r =r.Dokumnr == Dok.Dokumnr)
.OrderBy(r =r.Reanr).ToList();
Rids = new TableListCollection<TRow>(Grid.RowTable, tr);
Rids.ResetBindings();

However DataGridView still shows old rows.
I tried to re-assign DataGridView DataSource

DataSource = Rids;

but this causes DataGridView to lost all settings

How to refresh DataGridView after its BindingList is re-loaded from DataBase
?

Andrus

Aug 31 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Andrus" <ko********@hot.eewrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>I have Winforms DataGridView whose DataSource Rids is Marc sample
TableListCollection<TRowderived from BindingList.
It is used to edit invoice rows.
If user presses Revert button, my application reads original rows from
server database:

List<TRowtr;
tr = q.Where(r =r.Dokumnr == Dok.Dokumnr)
.OrderBy(r =r.Reanr).ToList();
Rids = new TableListCollection<TRow>(Grid.RowTable, tr);
Rids.ResetBindings();

However DataGridView still shows old rows.
I tried to re-assign DataGridView DataSource

DataSource = Rids;

but this causes DataGridView to lost all settings

How to refresh DataGridView after its BindingList is re-loaded from
DataBase ?

Andrus
Are you using a Binding Source? You should bind your datagridview to the
binding source, and the binding source to your data source.
The binding source is like oil on the gears, and keeps everything updated.
When you change its data source, it automatically handles redisplaying the
data in the grid.

RobinS.
GoldMail.com

Sep 4 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.