469,936 Members | 2,466 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

Repainting a DataGridView for CellFormatting events

I have an event handler on the CellFormatting event of a DataGridView. This
event handler highlights cells that are below a certain threshold. This
threshold value may change based on user actions. Once changed, any new cells
that scroll into view will use the new threshold value, but how could I
repaint the currently visible cells, i.e. how could I trigger the
CellFormatting event again for the cells already formatted?
Apr 26 '07 #1
2 11926
Hi Michael,

To get a DataGridView repainted, you may call the Refresh method of the
DataGridView.

Whenever the DataGridView is repainted, the CellFormatting event will be
raised once for each visible cell in the DataGridView.

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 8 '07 #2
Thank you--that is just what I needed to know.
May 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Robert Bravery | last post: by
3 posts views Thread by David Veeneman | last post: by
1 post views Thread by Dave | last post: by
reply views Thread by Dom | last post: by
4 posts views Thread by NvrBst | last post: by
reply views Thread by NvrBst | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.