?
Solved

VB.Net: Refresh ListView and DataGridView

Posted on 2012-04-09
3
Medium Priority
?
1,184 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 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