<?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 : Select/Focus a single row?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Select/Focus a single row?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 05 Jun 2026 22:01:01 +0000</pubDate>
  <lastBuildDate>Wed, 19 Apr 2006 17:55:43 +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=4030</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[Select/Focus a single row? : Thank you that worked.It actually...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4030&amp;PID=12303&amp;title=select-focus-a-single-row#12303</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1391">craig</a><br /><strong>Subject:</strong> 4030<br /><strong>Posted:</strong> 19 April 2006 at 5:55pm<br /><br />Thank you that worked.<br><br>It actually appears that I was adding the record I needed to select after calling populate which is why my original code was failing.&nbsp; Your code works too though, and I appreciate you taking the time to answer my question.&nbsp; In fact, I didn't discover my bug until I tried applying your code. <img src="http://forum.codejock.com/smileys/smiley5.gif" border="0"><br><br>--Craig<br><br>]]>
   </description>
   <pubDate>Wed, 19 Apr 2006 17:55:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4030&amp;PID=12303&amp;title=select-focus-a-single-row#12303</guid>
  </item> 
  <item>
   <title><![CDATA[Select/Focus a single row? :   craig wrote:I&amp;#039;m a bit...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4030&amp;PID=12299&amp;title=select-focus-a-single-row#12299</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1801">rmercer</a><br /><strong>Subject:</strong> 4030<br /><strong>Posted:</strong> 19 April 2006 at 4:05pm<br /><br /><P><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by craig" alt="Originally posted by craig" style="vertical-align: text-bottom;" /> <strong>craig wrote:</strong><br /><br /><SPAN style="FONT-FAMILY: Courier New,Courier,mono">I'm a bit stumped on how I can select and set focus to a CXTPReportRecord that I just added?&nbsp; Any help would be appreciated (I can submit a support ticket if that is preferable)</SPAN><SPAN style="FONT-FAMILY: Courier New,Courier,mono"><BR><BR>In my OnInitDialog method I am adding all of my records to the report control.&nbsp; As I add them, I am inspecting them to determine which row should be the one that is selected (Single selection).&nbsp; I store the pointer to this record and then after calling Populate() (which as I understand it will sort my records) I use the following code to set the stored record as selected/focused.&nbsp; It is selecting/focusing a different record than the one I cached the pointer to though.<BR><BR><BR>// pSelectedRecord is the record I just added to the<BR>// report control that I want to set as selected and<BR>// with focus<BR><BR>CXTPReportSelectedRows* pSelectedRows = m_wndSrsList.GetSelectedRows();<BR>&nbsp; if (pSelectedRows != NULL)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; int nRow = pSelectedRecord-&gt;GetIndex();<BR>&nbsp;&nbsp;&nbsp; CXTPReportRows* pRows = m_wndSrsList.GetRows();<BR>&nbsp;&nbsp;&nbsp; CXTPReportRow* pRow = pRows-&gt;GetAt(nRow); <BR>&nbsp;&nbsp;&nbsp; m_wndSrsList.SetFocusedRow(pRow);<BR>&nbsp;&nbsp;&nbsp; if (pRow != NULL)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pSelectedRows-&gt;Clear();<BR>&nbsp;&nbsp; &nbsp;&nbsp; pSelectedRows-&gt;Add(pRow);<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }</SPAN><BR></td></tr></table></P><P>Here's how I do it in my code, I also use groups so I have to expand the group too:</P><FONT size=2><P>m_ctlCategories.Populate();</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (p_record_selected != NULL)</P><P>{</P><P>&nbsp;&nbsp;&nbsp; p_rows = m_ctlCategories.GetRows();</P><P></FONT><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp; if</FONT><FONT size=2> (p_rows != NULL)</P><P>&nbsp;&nbsp;&nbsp; {</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p_row = p_rows-&gt;Find(p_record_selected);</P><P></FONT><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</FONT><FONT size=2> (p_row != NULL)</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</P><P> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;p_row-&gt;GetParentRow()-&gt;SetExpa nded(TRUE);</P><P> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; m_ctlCategories.SetFocusedRow(p_row);</P></FONT><FONT size=2><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P><P>}</P><P>&nbsp;</P><P>&nbsp;</P></FONT>]]>
   </description>
   <pubDate>Wed, 19 Apr 2006 16:05:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4030&amp;PID=12299&amp;title=select-focus-a-single-row#12299</guid>
  </item> 
  <item>
   <title><![CDATA[Select/Focus a single row? : I&amp;#039;m a bit stumped on how...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4030&amp;PID=12298&amp;title=select-focus-a-single-row#12298</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1391">craig</a><br /><strong>Subject:</strong> 4030<br /><strong>Posted:</strong> 19 April 2006 at 1:04pm<br /><br /><span style="font-family: Courier New,Courier,mono;">I'm a bit stumped on how I can select and set focus to a CXTPReportRecord that I just added?&nbsp; Any help would be appreciated (I can submit a support ticket if that is preferable)<br><br>In my OnInitDialog method I am adding all of my records to the report control.&nbsp; As I add them, I am inspecting them to determine which row should be the one that is selected (Single selection).&nbsp; I store the pointer to this record and then after calling Populate() (which as I understand it will sort my records) I use the following code to set the stored record as selected/focused.&nbsp; It is selecting/focusing a different record than the one I cached the pointer to though.<br><br><br>// pSelectedRecord is the record I just added to the<br>// report control that I want to set as selected and<br>// with focus<br><br>CXTPReportSelectedRows* pSelectedRows = m_wndSrsList.GetSelectedRows();<br>&nbsp; if (pSelectedRows != NULL)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; int nRow = pSelectedRecord-&gt;GetIndex();<br>&nbsp;&nbsp;&nbsp; CXTPReportRows* pRows = m_wndSrsList.GetRows();<br>&nbsp;&nbsp;&nbsp; CXTPReportRow* pRow = pRows-&gt;GetAt(nRow); <br>&nbsp;&nbsp;&nbsp; m_wndSrsList.SetFocusedRow(pRow);<br>&nbsp;&nbsp;&nbsp; if (pRow != NULL)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pSelectedRows-&gt;Clear();<br>&nbsp;&nbsp; &nbsp;&nbsp; pSelectedRows-&gt;Add(pRow);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }</span><br>]]>
   </description>
   <pubDate>Wed, 19 Apr 2006 13:04:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4030&amp;PID=12298&amp;title=select-focus-a-single-row#12298</guid>
  </item> 
 </channel>
</rss>