Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / November 2006

Tip: Looking for answers? Try searching our database.

DataGridView doesnt refresh after setting datasource

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
green@ids.net - 09 Nov 2006 03:46 GMT
Ok - I have a DataGridView that has its datasource set as a collection
of business objects.

When I go to add a row, I add it to a database table which then
re-creates the collection based off of the database.  The problem is
that when I go to set the datasource of the DataGridView to the newly
generated collection of business objects, the DataGridView doesn't
update right away...

What makes it more confusing is if I step through the application using
the debugger, it DOES work fine...

I thought maybe I had to do a "DoEvents()" type of dealio somewhere,
but alas, no...

Is there something obvious I'm missing?  Something I have to do once I
set the datasource to a new collection?  I've tried things like
DataGridViewObject.Update() and DataGridViewObject.Refresh() to no
avail...

Any help would be greatly appreciated...
RobinS - 09 Nov 2006 19:38 GMT
Have you tried setting the datasource on the grid to Nothing,
and then re-setting it to the data source?

Robin S.

> Ok - I have a DataGridView that has its datasource set as a collection
> of business objects.
[quoted text clipped - 17 lines]
>
> Any help would be greatly appreciated...

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.