Re: GDI leak in DataGridView

Tech-Archive recommends: Speed Up your PC by fixing your registry



In addition to the FreezePainting code mentioned above, here is
another thing you might try. Somehow, call suspendbinding on the
datasource. If you are using a BindingSource, you could try calling
BindingSource.SuspendBinding/ResumeBinding. Another way to do this is
through the CurrencyManager which also has a SuspendBinding/
ResumeBinding methods. To get the CurrencyMaanger, you can use code
like:

CurrencyManager cm = grid.BindingContext[grid.DataSource,
grid.DataMember] as CurrencyManager;

The FreezePainting will suspend the drawing of the control, whereas
the SuspendBinding will avoid the grid reacting to
IBindingList.ListChanged events.

=================
Clay Burch
Syncfusion, Inc.


.