<?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 : How to preserve the selections?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : How to preserve the selections?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 18 Apr 2026 07:05:51 +0000</pubDate>
  <lastBuildDate>Thu, 03 Jul 2008 11:15:05 +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=11296</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[How to preserve the selections? : I am using the report control...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11296&amp;PID=37786&amp;title=how-to-preserve-the-selections#37786</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4054">CHINSIANG</a><br /><strong>Subject:</strong> 11296<br /><strong>Posted:</strong> 03 July 2008 at 11:15am<br /><br /><DIV>I am using the report control to display a monitored data and constantly updated by a timer. </DIV><DIV>&nbsp;</DIV><DIV>But, when there is an update by calling "Populate()", all the existing selections will be cleared.</DIV><DIV>&nbsp;</DIV><DIV>Anyway to preserve the selection ? I have tried the following, but it crashed.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>// Keep the previous selections<BR>CArray&lt;CXTPReportRow*,CXTPReportRow*&gt; arrOldSelectedRows;<BR>CXTPReportSelectedRows *pSelRows = GetSelectedRows();<BR>int nRow;<BR>for (nRow = 0; nRow &lt; pSelRows-&gt;GetCount(); nRow++)<BR>{<BR>&nbsp;&nbsp;&nbsp; arrOldSelectedRows.Add(pSelRows-&gt;GetAt(nRow));<BR>}</DIV><DIV>&nbsp;</DIV><DIV>Populate();&nbsp;&nbsp;&nbsp; </DIV><DIV>// Restore the previous selections<BR>pSelRows = GetSelectedRows();</DIV><DIV>for (nRow = 0; nRow &lt; arrOldSelectedRows.GetSize(); nRow++)<BR>{<BR>&nbsp;&nbsp;&nbsp; pSelRows-&gt;Add(arrOldSelectedRows.GetAt(nRow)); // Crash here!!!!<BR>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>If crashed on this statement:</DIV><DIV>&nbsp;</DIV><DIV>void CXTPReportSelectedRows::Add(CXTPReportRow* pRow)<BR>{<BR>&nbsp;if (!pRow)<BR>&nbsp;&nbsp;return;</DIV><DIV>&nbsp;_NotifySelChanging(xtpReportSelectionAdd, pRow);</DIV><DIV>&nbsp;int nIndex = pRow-&gt;GetIndex(); //// Crashed here! </DIV><DIV>&nbsp;if (nIndex != -1)<BR>&nbsp;{<BR>&nbsp;&nbsp;AddBlock(nIndex, nIndex);<BR>&nbsp;}<BR>}<BR></DIV><DIV>&nbsp;</DIV><DIV>Any suggestion to preserve the selections?</DIV><DIV>&nbsp;</DIV><DIV>Thanks.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 03 Jul 2008 11:15:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11296&amp;PID=37786&amp;title=how-to-preserve-the-selections#37786</guid>
  </item> 
 </channel>
</rss>