<?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 : Highlight Selected Report Columns</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Property Grid : Highlight Selected Report Columns]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 19 Apr 2026 04:01:20 +0000</pubDate>
  <lastBuildDate>Wed, 18 Jun 2014 15:11:33 +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=22330</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[Highlight Selected Report Columns : Further update on item #1:Able...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22330&amp;PID=72547&amp;title=highlight-selected-report-columns#72547</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8725">eam74</a><br /><strong>Subject:</strong> 22330<br /><strong>Posted:</strong> 18 June 2014 at 3:11pm<br /><br />Further update on item #1:<br><br>Able to paint a particular column using a custom CXTPReportPaintManager that overrides DrawColumnBackground, as such:<br><br><font face="Courier New, Courier, mono">void CCustomReportPaintManager::DrawColumnBackground(CDC* pDC, CXTPReportColumn* pColumn, CRect rcColumn, BOOL&amp; bColumnPressed, BOOL&amp; bDraggingFromHeader, CXTPReportHeader* pHeader) {<br>&nbsp;&nbsp;&nbsp; if (pColumn-&gt;GetIndex()==1){ // column<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPReportRecords* rows = pColumn-&gt;GetControl()-&gt;GetRecords();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int i;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (i=0; i &lt; rows-&gt;GetCount(); i++) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPReportRecord* r = pColumn-&gt;GetControl()-&gt;GetRecords()-&gt;GetAt(i);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; r-&gt;GetItem(pColumn)-&gt;SetBackgroundColor(RGB(140, 240, 255));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pColumn-&gt;SetAlignment(xtpColumnTextRight);<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pColumn-&gt;SetAlignment(xtpColumnTextCenter);<br>&nbsp;&nbsp;&nbsp; }<br>}</font><br><br>Still some work left in tracking which is the currently selected column, and haven't found anything for item #2, but hopefully this is of use to someone searching in the future :)<br>]]>
   </description>
   <pubDate>Wed, 18 Jun 2014 15:11:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22330&amp;PID=72547&amp;title=highlight-selected-report-columns#72547</guid>
  </item> 
  <item>
   <title><![CDATA[Highlight Selected Report Columns : Updates!1. Based on the MessageRecord...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22330&amp;PID=72546&amp;title=highlight-selected-report-columns#72546</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8725">eam74</a><br /><strong>Subject:</strong> 22330<br /><strong>Posted:</strong> 18 June 2014 at 2:26pm<br /><br />Updates!<br><br>1. Based on the MessageRecord class in ReportSample, I created a custom record class which overrides GetItemMetrics.&nbsp; This works to alter the colors of the currently selected row, but no others.&nbsp; It appears to be calling this function for all rows so I don't know why it only changes colors for the selected row.<br><br>Code:<br><br><font face="Courier New, Courier, mono">void CCustomRecord::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics) {<br>&nbsp;&nbsp; &nbsp;if (pDrawArgs-&gt;pColumn-&gt;GetIndex() == 3) { // hard-coded temporarily<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pDrawArgs-&gt;pControl-&gt;GetPaintManager()-&gt;m_clrHighlight = RGB(140, 240, 255);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pDrawArgs-&gt;pControl-&gt;GetPaintManager()-&gt;m_clrHighlightText = RGB(0,0,0);<br>&nbsp;&nbsp; &nbsp;} else if (pDrawArgs-&gt;pRow-&gt;IsSelected()) {<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pDrawArgs-&gt;pControl-&gt;GetPaintManager()-&gt;m_clrHighlight = RGB(240, 140, 255);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pDrawArgs-&gt;pControl-&gt;GetPaintManager()-&gt;m_clrHighlightText = RGB(0,0,0);<br>&nbsp;&nbsp; &nbsp;}<br>}<br><br></font>3. <font face="Courier New, Courier, mono">reportCtrl.ShowRowFocus(FALSE);</font><br>]]>
   </description>
   <pubDate>Wed, 18 Jun 2014 14:26:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22330&amp;PID=72546&amp;title=highlight-selected-report-columns#72546</guid>
  </item> 
  <item>
   <title><![CDATA[Highlight Selected Report Columns : Hi all,I am working on a report...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22330&amp;PID=72545&amp;title=highlight-selected-report-columns#72545</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8725">eam74</a><br /><strong>Subject:</strong> 22330<br /><strong>Posted:</strong> 18 June 2014 at 11:30am<br /><br />Hi all,<br><br>I am working on a report control for my application and have a couple features that I haven't been able to find a solution for yet:<br><br>1. When a user clicks on an item, highlight the corresponding column.&nbsp; If you sort, the column will be highlighted, but in my control the sort must be disabled, so there is no highlight.<br><br>2. Allow the user to select multiple columns.&nbsp; I know this is possible because the report sample allows this, but I can't figure out where this option is set, unless this also is a consequence of disabling sorting.<br><br>3. (would be nice, but not critical) Remove the selection box around the row and customize the background color.&nbsp; I am able to turn off highlighting for the row with wndReport.SelectionEnable(FALSE) but the box still shows up.&nbsp; I found <a href="http://forum.codejock.com/forum_posts.asp?TID=3861" rel="nofollow">an old forum topic</a> which suggests the function to override is GetItemMetrics, which I did, but it's not getting called - where exactly should this be added?<br><br>TIA<br>]]>
   </description>
   <pubDate>Wed, 18 Jun 2014 11:30:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22330&amp;PID=72545&amp;title=highlight-selected-report-columns#72545</guid>
  </item> 
 </channel>
</rss>