Solved

VB.Net: Refresh ListView and DataGridView

Posted on 2012-04-09
3
1,136 Views
Last Modified: 2012-04-15
Hi Experts,

In a ListView or in DataGridView I fill data from the database, and the query may contain about a few hundred to thousands of records.

But if I make any changes to the values in the ListView or in the DataGridView (the changes are only to a few rows or for a few cells) and to view the changes I always refill the controls by re-querying, which is really inefficient.

Is there any method that I could use to only refresh a particular column or rows or cells, or a collection of them rather than refilling them in the ListView or in the DataGridView.

Thanks in advance.
0
Comment
Question by:baabaa_nl
3 Comments
 
LVL 12

Accepted Solution

by:
Alfredo Luis Torres Serrano earned 250 total points
Comment Utility
Sure,

   You have to deal with the CellEndEdit method and each time a cell is changed do a look in the table for the specific index (Id) and if the value is diferent just update thtat value in the listview or datagrid.

Hope this helps
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
Comment Utility
>But if I make any changes to the values in the ListView or in the DataGridView (the changes are only to a few rows or for a few cells) and to view the changes I always refill the controls by re-querying, which is really inefficient.

So you have two controls and you make changes in one and want to see the change reflected in another?
0
 

Author Comment

by:baabaa_nl
Comment Utility
Hi CodeCruiser,

I am using a Single datagridview and i make changes to certain cells in the gridview and when i click the save button, is it possible the edited cell to be updated to the database or to the dataset.

Thanks in advance.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now