﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » BusinessBindingSource.vb &amp;gt; ClearBusinessObjectList causing slow form close</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 02:36:16 GMT</lastBuildDate><ttl>20</ttl><item><title>BusinessBindingSource.vb &amp;gt; ClearBusinessObjectList causing slow form close</title><link>http://forum.strataframe.net/FindPost27495.aspx</link><description>Hi,&lt;br&gt;
&lt;br&gt;
We have just added a (DevExpress) Pivot Grid control to an app and a user reported very slow form closing (2+ minutes) when he had a fair amount of data in the Pivot Grid (50,000 rows).&lt;br&gt;
&lt;br&gt;
On closer investigation we see this is also the case in a normal Devexpress Grid. We hadn't noticed this before because our users would rarely have more than 2 or 3,000 rows in a grid - generally just a few hundred.&lt;br&gt;
&lt;br&gt;
In tracking down the issue we see that it's in BusinessBindingSource &gt; ClearBusinessObjectList. Please see the attached to screen shots:&lt;br&gt;
&lt;br&gt;
SF_Dispose_01 - here the code is disposing of a BO (for a Pivot Grid) with 2826 rows in the grid.&lt;br&gt;
SF_Dispose_02 - here the code is disposing of a BO (for normal Grid) with 23664 rows in the grid.&lt;br&gt;
&lt;br&gt;
The problem is that line 244 is executed for every row in the BO rather than once for the BO.&lt;br&gt;
&lt;br&gt;
We are using SF 1.7.0.7 in a VS2010 development environment.&lt;br&gt;
&lt;br&gt;
This is proving to be a real nuisance for our user so, if possible, an early fix would be appreciated - even if it mean having to change our copy of the source code ourselves until a more formal fix is provided in a new release.&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 22 Jun 2010 07:29:08 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: BusinessBindingSource.vb &amp;gt; ClearBusinessObjectList causing slow form close</title><link>http://forum.strataframe.net/FindPost27511.aspx</link><description>Glad to hear that Peter. &lt;/P&gt;&lt;P&gt;Sorry for the misunderstanding. I got the idea you were suggesting that the .Dispose should be moved outside the loop. ;)</description><pubDate>Tue, 22 Jun 2010 07:29:08 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BusinessBindingSource.vb &amp;gt; ClearBusinessObjectList causing slow form close</title><link>http://forum.strataframe.net/FindPost27509.aspx</link><description>Hi Ivan,&lt;br&gt;
&lt;br&gt;
We have a solution to our problem - so no urgency for any changes in the SF area. Rather than use a BO to populate the Pivot Grid we now use the BO's data table. The following code has been added just after the refresh of the BO using the current data selection criteria (dtForPivotGrid is a data table).&lt;br&gt;
&lt;br&gt;
        dtForPivotGrid = Me.BoHPCForPivot1.CurrentDataTable&lt;br&gt;
&lt;br&gt;
        Me.PivotGridControl1.DataSource = dtForPivotGrid&lt;br&gt;
&lt;br&gt;
        Me.BoHPCForPivot1.Clear()&lt;br&gt;
&lt;br&gt;
This change has had an enormous impact. The form close is now instant but the time it takes to refresh the Pivot Grid has also been dramatically reduced. When the Pivot Grid used the BO refreshing it with (say) 200,000 records took about 4 minutes. Now the BO's data table is used (rather than the BO object itself) the Pivot Grid refresh just takes around 15 seconds.&lt;br&gt;
&lt;br&gt;
Cheers, Peter</description><pubDate>Mon, 21 Jun 2010 20:07:45 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: BusinessBindingSource.vb &amp;gt; ClearBusinessObjectList causing slow form close</title><link>http://forum.strataframe.net/FindPost27508.aspx</link><description>Hi Ivan,&lt;br&gt;
&lt;br&gt;
I wan't proposing a solution - I was just bringing what I thought to a bug to your attention.&lt;br&gt;
&lt;br&gt;
Are you saying it is 'by design' and we have to live with it?&lt;br&gt;
&lt;br&gt;
Cheers, Peter</description><pubDate>Mon, 21 Jun 2010 17:20:15 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: BusinessBindingSource.vb &amp;gt; ClearBusinessObjectList causing slow form close</title><link>http://forum.strataframe.net/FindPost27496.aspx</link><description>Hi Peter.&lt;/P&gt;&lt;P&gt;I have a feeling your solution wouldn't work, as the BBS IBindingList interface expects a unique instance of an object for each row instance, that is why you have seem the BO for each instance being disposed.</description><pubDate>Mon, 21 Jun 2010 07:47:38 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>