473,382 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Refreshing DataGridView

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
1 2800

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RSH | last post by:
I have a situation where I have a Master form that contains a DataGridView. Each row has a details... button that spawns a new winform which shows many more fields than the DataGridView. The user...
0
by: Bob | last post by:
I have relational integrity set up in my sql server 2005 database that prevents cascading deletes in some cases. I'm using a bound datagrid view and a tablenavigator. When I click the delete...
1
by: Steve | last post by:
I have a bound DataGridView. When I add an item to the DataSource, the DataGridView won't reflect the new row. I have googled and googled, no solution that I have found online works. One thing...
1
by: Greg | last post by:
I'm using a DataGridView object bound to an xml datasource. I have added 2 unbound columns which are populated based on the calculations of data from other columns. When the data in the other...
3
by: steve | last post by:
Hi All How can I get the datagridview to redraw after changing the rowtemplate.height at runtime ( it is databound to a datatable) I have tried datagridview1.refresh etc to no avail (The row...
0
by: lv2compute | last post by:
I am having a problem with my datagridview. I have a small table that has two columns. The first column is bound to my dataset. The second column is a combobox. I add items to the combobox based on...
1
by: romerve | last post by:
Hello; i am having some problems trying to get a form that has a datagridview to refresh after a new record is created. I have a MDI container and menu form and add new record form; the menu...
1
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two...
0
by: enrico via DotNetMonster.com | last post by:
as a way of refreshing my datagridview i rerun my query after every command. on my delete button i use the same procedure but as a result it will clear all the results. can anyone help me how to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.