473,654 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

refresh DataGridView

Hi,

In the same application, some other form inserted some data to the
database.

To refresh the DataGridView on the form shows those data, I just simple use
Adapter fill the grid again.

//auto-generated code
this.projectTab leAdapter.Fill( this.dsPowerCap i.project);

This works, but is this "right" way to do? I feel it is not very elegant.

Thanks,

~.~.~.~.~.~.~.~ .~.~.~.~.~.~.~. ~.~.~.~.

Ryan Liu
Shanghai Fengpu Software Co. Ltd
Shanghai , China

http://www.PowerCATI.com Powerful CATI!
http://www.fpsoft.net.cn
~.~.~.~.~.~.~.~ .~.~.~.~.~.~.~. ~.~.~.~.

Jan 14 '08 #1
2 2512
Sounds just fine to me. What alternative were you expecting to use?
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Ryan Liu" wrote:
Hi,

In the same application, some other form inserted some data to the
database.

To refresh the DataGridView on the form shows those data, I just simple use
Adapter fill the grid again.

//auto-generated code
this.projectTab leAdapter.Fill( this.dsPowerCap i.project);

This works, but is this "right" way to do? I feel it is not very elegant.

Thanks,

~.~.~.~.~.~.~.~ .~.~.~.~.~.~.~. ~.~.~.~.

Ryan Liu
Shanghai Fengpu Software Co. Ltd
Shanghai , China

http://www.PowerCATI.com Powerful CATI!
http://www.fpsoft.net.cn
~.~.~.~.~.~.~.~ .~.~.~.~.~.~.~. ~.~.~.~.

Jan 14 '08 #2
Maybe just added those lines to grid instead of complete reload. I hesitate
to do so since I need add more code.

Thanks,

"Peter Bromberg [C# MVP]" <pb*******@yaho o.NoSpamMaam.co m写入消息
news:C2******** *************** ***********@mic rosoft.com...
Sounds just fine to me. What alternative were you expecting to use?
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Ryan Liu" wrote:
>Hi,

In the same application, some other form inserted some data to the
database.

To refresh the DataGridView on the form shows those data, I just simple
use
Adapter fill the grid again.

//auto-generated code
this.projectTab leAdapter.Fill( this.dsPowerCap i.project);

This works, but is this "right" way to do? I feel it is not very elegant.

Thanks,

~.~.~.~.~.~.~. ~.~.~.~.~.~.~.~ .~.~.~.~.

Ryan Liu
Shanghai Fengpu Software Co. Ltd
Shanghai , China

http://www.PowerCATI.com Powerful CATI!
http://www.fpsoft.net.cn
~.~.~.~.~.~.~. ~.~.~.~.~.~.~.~ .~.~.~.~.

Jan 15 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9643
by: thomasp | last post by:
This is a two part question, 1) The code below should display a form with a datagridview and a few command buttons. This form should allow the user to make change to the records displayed in the datagridview and have to changes written to the Filters table in an MS Access database. The if the user chooses, clicking on the Restore button empties the contents of the Filters table, refills it with the contents of the DefaulFilters...
1
3142
by: RSH | last post by:
Hi, I have a situation where I have a DDL that lists all of the tables in a particular database, and a Datagridview which appears in the same from below the DDL.. When the user selects a new database table from the list I refresh the datagridview with the newly selected tables data. This works fine but after a few tables have been selected it takes a very long time to load some of the tables. Some tables that contain only one row of...
6
50448
by: George | last post by:
Hi, I have been encountering a refresh problem with DataGridView, which is bound to a DataTable. When I make updates (Add, Delete, update) to the DataGridView, everything flow nicely to DataTable. No problem here. However, when I add data (programatically) to the DataTable, the DataGridView does not refresh right away. If I minimize and show my form,
12
6032
by: martin1 | last post by:
All, is there window form refresh property? I try to set up window form refresh per minute. Thanks
2
5013
by: Ivan | last post by:
I have a class Foo which have two property. I have a thread that do some process and update class Foo int B. I have a datagridview on main form. this datagridview data source to this class Foo and column A binds to string A and column B binds to int B. When i start two threads, the datagridview able to show two rows and updated int B at run time. How? public class Foo { public Foo()
3
7537
by: David Cartwright | last post by:
Hi all, I'm having a weird time with a call to the Refresh() method of a DataGridView. I have a VB.NET 2005 Windows application with a main form and a "worker" thread. The main form delegates a Sub to the worker so that the latter can refresh the DataGrid after updating the DataTable driving it. When I run the app under the debugger, everything's fine. But when I run it for real, it hangs, apparently in the Refresh() method of the...
7
7379
by: mvenkatesan | last post by:
Hi guys I am win appl. I was bind the datagridview from datatable. i was changed datas @ runtime. datatable changed but my datagridview not refresh. I written dagaridview.refresh(); not work how to refresh? Thanks in advance Venky
1
8733
by: MFayaz | last post by:
Hello! I have to refresh datagridview when database update , IS there any way to solution that my datagridview auto refresh when any user update database. Thanks in Advance
2
5520
by: YouPoP | last post by:
Hi, I have a Window Form to which i added a datagridview. The binding source is working well, but does not update if the database is modified outside the application (i mean not showing the modification made to the database). Trying to solve my problem, i added a timer to the form that Fill the datagridview every xx milliseconds (basically a timer that calls the Form_Load method). The timer is working nicely, but because it always refresh...
1
3734
by: Aegixx | last post by:
Ok, extremely wierd situation here: (I'll post the code below, after the explanation) I've got a Windows application (.NET 3.5) that has a single Form with a DataGridView embedded. The user presses a button to do a SQL query (fill a DataSet). Before firing the query, I disable the grid/buttons and turn on UseWaitCursor. After it completes, I re-enable the grid/ buttons, refresh the dataset, then turn off the UseWaitCursor. If I...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.