By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,914 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,914 IT Pros & Developers. It's quick & easy.

Update DataGridView Control

P: n/a
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 cellvaluechanged event of the DataGridView control and thought
it would be fired when the Dataset(the DataGridView's datasource) is updated.
CellValueChanged 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
Share this Question
Share on Google+
1 Reply


P: n/a
"David" <Da***@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.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 cellvaluechanged event of the DataGridView control and
thought
it would be fired when the Dataset(the DataGridView's datasource) is
updated.
CellValueChanged 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.CellValueChanged 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 discussion thread is closed

Replies have been disabled for this discussion.