473,546 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update DataGridView Control

I have a realtime stock quote system developed where I am updating a typed
dataset with realtime quotes. I want my DataGridView control to show green
forecolor when a price moves up and red forecolor when a price moves down. I
am using the cellvaluechange d event of the DataGridView control and thought
it would be fired when the Dataset(the DataGridView's datasource) is updated.
CellValueChange d is not fired when the dataset is updated. Is there another
DataGridView event handler I need to use for this?
Thanks,
David
Jun 5 '06 #1
1 3735
"David" <Da***@discussi ons.microsoft.c om> wrote in message
news:4F******** *************** ***********@mic rosoft.com...
I have a realtime stock quote system developed where I am updating a typed
dataset with realtime quotes. I want my DataGridView control to show
green
forecolor when a price moves up and red forecolor when a price moves down.
I
am using the cellvaluechange d event of the DataGridView control and
thought
it would be fired when the Dataset(the DataGridView's datasource) is
updated.
CellValueChange d is not fired when the dataset is updated. Is there
another
DataGridView event handler I need to use for this?


From trhe help on DataGridView "The DataGridView.Ce llValueChanged event
occurs when the user-specified value is committed, which typically occurs
when focus leaves the cell.", i.e. this event is used for changes the user
makes. You could probably use the CellFormatting event for your colour
changes, but be aware that this event will be called whenever the cell needs
to be painted (e.g. if the user scrolls the grid, or minimises then restores
the application) and not just when the bound value has changed.

Chris Jobson
Jun 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
13331
by: milk-jam | last post by:
I'm trying to set my datagridview so that the first row will be left blank and to use it as a filtering filed for the datagridview. Until now I was using 2 datagridview the upper one with a header that sort and one row for filtering and the lower one with no header for the data. Only it is very complicated to work this way cause for example...
2
4547
by: Ye Li | last post by:
I have two windows with datagridview control type in one form. I want to move multiple rows from one datagridview to another datagridview. My code is as follows: private void btn_Forward_Click(object sender, EventArgs e) { int movedItemCount = dg_QuestionSource.SelectedRows.Count; for (int i = 0; i < movedItemCount; i++) {
1
1776
by: manjub | last post by:
Hi, I was working on an MDI application using Visual C++ 2005 .NET. In a child window, I have an instance of DataGridView control. If I open several child windows, they all work fine. However, if I close one of the child windows and try to add a row to DataGridView control that is active, I get an error...
1
2298
by: Rich | last post by:
Hello, I am reading data from a sql server table that is under replication. This table has the replicatin GUID column that is generated with replicatin. I am reading the data from a dataAdapter/Dataset using a dataview which is the data source for a datagridview control. When I scroll horizontally in the datagridview control and reach...
1
1051
by: Jeet Disuja | last post by:
Dear Sir, I m develop a application in vb.net which update a live prices of stocks by a website named (www.nseindia.com) i m using datagridview control for this. Please give ur suggestion how can i bind my datagridview control to www.nseindia.com website for live updation of stocks.
0
1680
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
I am a .NET newbie, specifically WinForms. I have a simple Winform for which I have a "How To" question: My WinForm app will display data from a FoxPro database, two tables in particular: Patients, and Sessions. There is one record in the Patients table for each patient. The PatientID is the primary key. The sessions table contains all of...
0
1411
by: RickH | last post by:
Has anyone tried wrapping the DataGridView control itself as a custom Cell/Column control. So that I can have a child DataGridView appear in a column of a parent DataGridView so that the columns/rows of the childdren can be edited like a grid on the parent rows grid. The MS examples all show how to make parent/child data grids appear in...
1
1168
by: shajeela | last post by:
1.I create a datagridview control 2.connected using a oledb adapter 3.problem is if i run the program the old value is displayed 4.for viewing the old value i have to close the current window,and run once again
1
10119
by: Singh Harminder | last post by:
I created few datagridview columns and then tried to add them to the datagridview columns collection, but got error : At least one of the DataGridView control's columns has no cell template. Code: DataGridView dt = new DataGridView(); DataGridViewColumn dt1 = new DataGridViewColumn(); dt1.Name = "col1"; dt1.HeaderText = "col1"; ...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7794
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5361
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.