DataGridView renderer

  • Thread starter Thread starter Peter Larsen [CPH]
  • Start date Start date
P

Peter Larsen [CPH]

Hi,

I have a problem with DataGridView. It seems sometimes very slow on update
(refresh).
I can't figure out what cause this problem.

Reading about this on the internet, it seems to be a renderer issue.
Sometimes the problem seems to go away if i remove a groupbox or just
reallocate the datagridview on the form. Sometimes it won't go away.

Any ideas what to do ??

Best Regards
Peter
 
Hi Peter,

Thank you for using Microsoft Managed Newsgroup Service, I'm Zhi-Xin Ye,
it's my pleasure to work with you on this issue.

Before we go any further, would you mind confirming some points with me?

1. What do you mean of "slow on update(refresh)"? The painting of the
DataGridView is slow or the loading of data in the DataGridView is slow?
2. Do you have large amount of data in the DataGridView?
3. Which version of .NET Framework are you using?

Anyway, you can try the followings:

1. Try DataGridView's SuspendLayout()/ResumeLayout() methods;
2. Try DataTable's BeginLoadData()/EndLoadData() methods to avoid sending
notifications;
3. Try BindingSource.SuspendBinding()/ResumeBinding() method to avoid
sending notifications;
4. Use VirtualMode on DataGridView if you're dealing with large amount of
data;

You can also refer to this feedback and check the workarounds there:

DataGridView rendering is very slow
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba
ckID=117093&wa=wsignin1.0

Documents for your information:

Control.SuspendLayout Method
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.suspend
layout.aspx

DataTable.BeginLoadData method
http://msdn.microsoft.com/en-us/library/system.data.datatable.beginloaddata.
aspx

BindingSource.SuspendBinding method
http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.s
uspendbinding.aspx

Virtual Mode in the Windows Forms DataGridView Control
http://msdn.microsoft.com/en-us/library/ms171622.aspx

I look forward to your reply.

Best Regards,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 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. 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/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Zhi-Xin

Thanks for your reply.
I'm using .Net 3.5, C# and winforms on Visual Studio 2008.

First i did not know whether it was the datasource or the renderer, that
caused this problem.
So i did some testing and found that it doesn't matter in this case.
The datagridview is slow even with no datasource attached.

Removing Application.EnableVisualStyles from program.cs helps a lot, but
still...
It seems like the control just do to much drawing.

BR
Peter
 
Hi Peter,

Could you send me a concise-but-complete sample to reproduce this problem?
I'm email is (e-mail address removed).

Best Regards,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

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