473,377 Members | 1,153 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,377 software developers and data experts.

DGV refresh/update

Does anyone know how to stop a datagridview from either stopping the display update or to slow down the refresh rate on it?

I have a lot of data I would like to display but I only want it to update like once a second or something.

dgv1.datasource = myDT;

is updating every time the datable updates.

TIA
Aug 10 '10 #1
5 1918
Aimee Bailey
197 Expert 100+
Simple answer, DGV is very good at managing what is shown so i would stay away from trying to interfere with that, instead, what i'd reccomend is seeing weather the datatable in the background really needs to update so often, instead maybe have a second datatable that works as a snapshot for what you are looking at, then use that second one as the datasource.

Only an idea, but i promise it's worth looking into :)

Aimee.
Aug 10 '10 #2
Aimee, thank you for your reply.

Are you suggesting something like this:

Expand|Select|Wrap|Line Numbers
  1.  //class variables
  2.         DateTime uTime = DateTime.Now;
  3.         double mySecCheck;
  4.         DataTable dt1;
  5.         DataTable dt2;
  6.  
  7.         private void procDGVTimer()
  8.         {
  9.  
  10.             DateTime eTime = DateTime.Now;
  11.             TimeSpan dSpan = eTime - uTime;
  12.  
  13.             mySecCheck = dSpan.Seconds + (dSpan.Minutes * 60);
  14.  
  15.             if (mySecCheck > 1)
  16.             {
  17.  
  18.                 dt2 = dt1.Clone();
  19.                 dgv1.DataSource = dt2;
  20.                 utime = DateTime.Now;
  21.             }
  22.  
Aug 10 '10 #3
Aimee Bailey
197 Expert 100+
Well thats one way to go about it :) may i ask where your data is coming from? is it a database, or something different?

Aimee
Aug 10 '10 #4
Aimee,

Ya, I wasn't sure what you were hinting at. From my understanding, if you make a datatable equal to another it creates a pointer. But if I clone, I think that maybe really cpu intensive.


1. Get live data
2. Process in seperate class to create new data.
3. Data is changed in the datatable.

I get data and convert it into something else. I track what row through out and set that row and column in the datagridview datatable.
Aug 10 '10 #5
Aimee Bailey
197 Expert 100+
In the case of an SQL database then, id suggest optimizing your system where it only retrieves the data needed rather than everything. For instance i am currently working on a Gantt package for orders, ive narrowed what i show though by week (this is done in my queries), also to optimize my queries, i try to keep them small where possible, and ordered by column importance. (i.e. indexed ID first).
Aug 10 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
2
by: Lo?c Mah? | last post by:
Hello I have a problem to update the content of a wx.Panel already displayed after changing a variable, used to define the wx.Panel content. I have the following elements in my code: ...
5
by: Andrew Chanter | last post by:
I have a situation where I am using an unbound dialog form to update data in an Access 2002 split back end / front end scenario. The data update is done via an ADO call (direct to the back end...
6
by: Jax | last post by:
I'm kind of used to the windows forms make a change then type down the good ol' this.refresh(). But in web forms i dont seem to have that choice no refresh, update or anything that sounds vaguely...
2
by: aldous scotch | last post by:
I designed a Crystal Report .rpt from within Microsoft Development Environment 2003 Version 7.1.3088 (VB .NET IDE). I selected database fields from the left side Field Explorer onto the Details...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
7
by: John J. Hughes II | last post by:
I have a DataGridView with a TextBoxColumn. I setting the data source to a List<stringvalue in a static class. The list is filled from a background thread. So far all is fine and it works...
6
by: Chris Larmer | last post by:
I have two subforms in my main form. In the main form I want the user to select a customer, class, and date range. The 2 subforms are similar. One is the history records in the recent past and the...
1
by: Trey | last post by:
I have an unbound datagridview with three comboboxes (e.g. A, B, C) All three comboboxes share the same datasource and use the same valuemember. If I change the value of say combobox A, then B and...
1
by: MayoM | last post by:
My form has some simple validation in the Before Update event. If the validation fails the code ends with DoCmd.CancelEvent The form also has an Update command button. This simply runs ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.