Solved

VB.Net: Refresh ListView and DataGridView

Posted on 2012-04-09
3
1,175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
Alfredo Luis Torres Serrano earned 250 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 250 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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