Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.Net: Refresh ListView and DataGridView

Posted on 2012-04-09
3
Medium Priority
?
1,207 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 1000 total points
ID: 37822950
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 1000 total points
ID: 37832910
>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
ID: 37846355
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

926 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