<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Performance problem when deleting items from grid</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Property Grid : Performance problem when deleting items from grid]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 19 Apr 2026 09:00:27 +0000</pubDate>
  <lastBuildDate>Tue, 08 Jan 2008 10:19:24 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=9211</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hi Oleg,your are right: The code...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29969&amp;title=performance-problem-when-deleting-items-from-grid#29969</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1169">farr02</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 08 January 2008 at 10:19am<br /><br />Hi Oleg,<br><br>your are right: The code works fine.<img src="http://forum.codejock.com/smileys/smiley32.gif" border="0" align="absmiddle"> <br>Thank you very much.<br><br>Bye<br>&nbsp;&nbsp; Holger<br><br>]]>
   </description>
   <pubDate>Tue, 08 Jan 2008 10:19:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29969&amp;title=performance-problem-when-deleting-items-from-grid#29969</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hi, Last version to try: :)  void...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29940&amp;title=performance-problem-when-deleting-items-from-grid#29940</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 08 January 2008 at 2:03am<br /><br /><DIV>Hi,</DIV><DIV>Last version to try: :)</DIV><DIV>&nbsp;</DIV><DIV>void BeginUpdate()<BR>{<BR>&nbsp;&nbsp;&nbsp; GetGridView().m_nLockUpdate = 1;<BR>&nbsp;&nbsp;&nbsp; GetGridView().SetRedraw(FALSE);</DIV><DIV>&nbsp;&nbsp;&nbsp; <strong>GetGridView().().ResetContent();</strong><BR>}</DIV><DIV>void EndUpdate()<BR>{<BR>&nbsp;&nbsp;&nbsp; GetGridView().m_nLockUpdate = 0;<BR>&nbsp;&nbsp;&nbsp; <strong>GetGridView().SetRedraw(TRUE);</strong></DIV><DIV>&nbsp;&nbsp;&nbsp; Refresh();<BR>}<BR></DIV><DIV>&nbsp;</DIV><DIV>Think it will work fine.</DIV>]]>
   </description>
   <pubDate>Tue, 08 Jan 2008 02:03:32 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29940&amp;title=performance-problem-when-deleting-items-from-grid#29940</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hello Oleg,doesn&amp;#039;t work either:-(I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29917&amp;title=performance-problem-when-deleting-items-from-grid#29917</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1169">farr02</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 07 January 2008 at 4:50am<br /><br />Hello Oleg,<br><br>doesn't work either:-(<br>I uploaded two files regarding the access violation: Number one ( <a href="uploads/20080107_042735_CJ_Fhut.zip" target="_blank">uploads/20080107_042735_CJ_Fhut.zip </a>) is a crash dump file saved with WinDbg (WinDbg command: .dump /mFhut CJ_Fhut.dmp) and the second (&nbsp;<a href="uploads/20080107_043556_ProblemItemRemo.zip" target="_blank">uploads/20080107_043556_ProblemItemRemo.zip</a> )gives you a small description of the functions I inserted to the lib, and some more information about the access violation.<br><br>Hope it helps.<br>Bye<br>&nbsp;&nbsp; Holger<br><br><br>]]>
   </description>
   <pubDate>Mon, 07 Jan 2008 04:50:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29917&amp;title=performance-problem-when-deleting-items-from-grid#29917</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hi, Think also you need call...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29878&amp;title=performance-problem-when-deleting-items-from-grid#29878</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 04 January 2008 at 8:36am<br /><br />Hi,<DIV>Think also you &nbsp;need call Refresh() in the end.&nbsp; (after SetRedraw(FALSE))</DIV>]]>
   </description>
   <pubDate>Fri, 04 Jan 2008 08:36:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29878&amp;title=performance-problem-when-deleting-items-from-grid#29878</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hi Oleg,doesn&amp;#039;t work It leads...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29875&amp;title=performance-problem-when-deleting-items-from-grid#29875</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1169">farr02</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 04 January 2008 at 6:21am<br /><br />Hi Oleg,<br>doesn't work <img src="http://forum.codejock.com/smileys/smiley19.gif" border="0" align="absmiddle"><br>It leads to an access violation in CXTPPropertyGridView::_RefreshIndexes(). I have tried to eliminate the call to Refresh in the CXTPPropertyGridItem::Remove function but that gives me other errors.<br>So I think for the moment it is the best to stay with the current situation and hope for one of the next releases. Or do you have a better idea?<br><br>Thank you yery much.<br>Bye<br>&nbsp;&nbsp; Holger<br>]]>
   </description>
   <pubDate>Fri, 04 Jan 2008 06:21:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29875&amp;title=performance-problem-when-deleting-items-from-grid#29875</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : oh, right, it deletes content.  ok,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29860&amp;title=performance-problem-when-deleting-items-from-grid#29860</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 03 January 2008 at 11:18am<br /><br />oh, right, it deletes content.<DIV>&nbsp;</DIV><DIV>ok, try this</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;wndGrid.GetGridView().m_nLockUpdate = 1;<BR>&nbsp;wndGrid.GetGridView().SetRedraw(FALSE);</DIV><DIV>&nbsp;</DIV><DIV><DIV>&nbsp;wndGrid.GetGridView().m_nLockUpdate = 0;<BR>&nbsp;wndGrid.GetGridView().SetRedraw(FALSE);</DIV></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 03 Jan 2008 11:18:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29860&amp;title=performance-problem-when-deleting-items-from-grid#29860</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hello Oleg,I have already made...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29858&amp;title=performance-problem-when-deleting-items-from-grid#29858</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1169">farr02</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 03 January 2008 at 10:41am<br /><br />Hello Oleg,<br><br>I have already made some testing with Begin/EndUpdate before. When I just put them around the while-loop in the above code, the result is an empty grid. As far as I understood (please correct me if I am wrong) BeginUpdate stores some information about some grid states, disables refresh and redraw and finally deletes the whole grid. EndUpdate restores the saved states,&nbsp; enables refresh and redraw and then redraws the grid. That means I have to rebuild my whole dialog inside a Begin/EndUpdate-block instead of just inserting or deleting a number of items into resp. from the existing dialog.<br><br>Maybe this is an item for the wish-list:<br>Implement a function that locks grid refreshing and redrawing during a bunch of insertion or removal operations without the need to rebuild the whole dialog.<br><br>Bye<br>&nbsp;&nbsp; Holger<br><br>PS: I have forgotten in my first post: Happy New Year!<br>]]>
   </description>
   <pubDate>Thu, 03 Jan 2008 10:41:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29858&amp;title=performance-problem-when-deleting-items-from-grid#29858</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hi,  There are BeginUpdate,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29852&amp;title=performance-problem-when-deleting-items-from-grid#29852</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 03 January 2008 at 6:57am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>There are BeginUpdate, EndUpdate methods. </DIV><DIV>call them before/after your loop.</DIV>]]>
   </description>
   <pubDate>Thu, 03 Jan 2008 06:57:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29852&amp;title=performance-problem-when-deleting-items-from-grid#29852</guid>
  </item> 
  <item>
   <title><![CDATA[Performance problem when deleting items from grid : Hello,in my application I noticed...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29849&amp;title=performance-problem-when-deleting-items-from-grid#29849</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1169">farr02</a><br /><strong>Subject:</strong> 9211<br /><strong>Posted:</strong> 03 January 2008 at 4:00am<br /><br />Hello,<br>in my application I noticed a performance problem when deleting a large number of elements from the grid via pItem-&gt;Remove();<br>Example:<br>First I create a large number of categories each holds two items:<br><table width="99%"><tr><td><pre class="BBcode">CString sCatName;<br>g_pCustom = m_wndPropertyGrid.AddCategory(_T("Long Dialog"));<br>for(int i = 0; i &lt; 512; ++i)<br>{<br>&nbsp;&nbsp;&nbsp; sCatName.Format(_T("Category %03d"), i);<br>&nbsp;&nbsp;&nbsp; CXTPPropertyGridItem* pCat = <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; g_pCustom-&gt;AddChildItem(new CXTPPropertyGridItemCategory(sCatName));<br>&nbsp;&nbsp;&nbsp; pCat-&gt;AddChildItem(new CXTPPropertyGridItemNumber(_T("Element 1"), i));<br>&nbsp;&nbsp;&nbsp; pCat-&gt;AddChildItem(new CXTPPropertyGridItemNumber(_T("Element 2"), i));<br>&nbsp;&nbsp;&nbsp; pCat-&gt;Expand();<br>}<br>g_pCustom-&gt;Expand();<br></pre></td></tr></table><br><br>Then I delete 'Element 1' in every category using the following code:<br><table width="99%"><tr><td><pre class="BBcode">if(g_pCustom)<br>{<br>&nbsp;&nbsp;&nbsp; CXTPPropertyGridItems* pItems = g_pCustom-&gt;GetChilds();<br>&nbsp;&nbsp;&nbsp; if(pItems)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int i = pItems-&gt;GetCount() - 1;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while (i &gt;= 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPPropertyGridItem* pCategory = pItems-&gt;GetAt(i);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if(pCategory)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPPropertyGridItems* pElements = pCategory-&gt;GetChilds();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(pElements)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPPropertyGridItem* pElement1 = pElements-&gt;GetAt(0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(pElement1)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // here 'Element 1' will be deleted<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pElement1-&gt;Remove();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pElement1 = 0;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; --i;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br></pre></td></tr></table><br>The removal of the elements takes more than a minute in release configuration on a 3 GHz computer running Win XP and ToolkitPro v9.81, whereas creation time is less than a second.<br>Is something wrong with my code or takes the remove-function so much time?<br>(I think the problem may be the call to m_pGrid-&gt;Refresh(); in the remove function.)<br>How can I speed up the removal?<br><br>Bye<br>&nbsp;&nbsp; Holger<br><br>]]>
   </description>
   <pubDate>Thu, 03 Jan 2008 04:00:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9211&amp;PID=29849&amp;title=performance-problem-when-deleting-items-from-grid#29849</guid>
  </item> 
 </channel>
</rss>