<?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 : [SOLVED] Using BeforeDrawRow with a TreeColum</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : [SOLVED] Using BeforeDrawRow with a TreeColum]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 15 May 2026 04:28:26 +0000</pubDate>
  <lastBuildDate>Thu, 13 May 2010 05:01:31 +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=16687</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[[SOLVED] Using BeforeDrawRow with a TreeColum :  Yeah finding out about the use...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58480&amp;title=solved-using-beforedrawrow-with-a-treecolum#58480</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 16687<br /><strong>Posted:</strong> 13 May 2010 at 5:01am<br /><br />Yeah finding out about the use of the Metrics object has been a definite help as I had always wondered how to change an individual column colour also. <br><br>As for the messy code, this was only there in the interim as I would not have been happy to let that stay!!! lol<br><br>Thanks again.<br>]]>
   </description>
   <pubDate>Thu, 13 May 2010 05:01:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58480&amp;title=solved-using-beforedrawrow-with-a-treecolum#58480</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] Using BeforeDrawRow with a TreeColum : Hi,  Of course you are right...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58479&amp;title=solved-using-beforedrawrow-with-a-treecolum#58479</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 16687<br /><strong>Posted:</strong> 13 May 2010 at 4:45am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Of course you are right about removing .Redraw method, I just copied your code and changed Item.ForeColor into Metrics.ForeColor and didn't remove .Redraw <img src="https://forum.codejock.com/smileys/smiley9.gif" border="0">&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Metrics object is using copy of row/record/item collection and is able to update values immediately <strong>without</strong> changing original values. This is nice for just changing visual effects in ReportControl. Well, glad to solve your problem without the "messy code" <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 13 May 2010 04:45:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58479&amp;title=solved-using-beforedrawrow-with-a-treecolum#58479</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] Using BeforeDrawRow with a TreeColum : Cheers Aaron...I must admit that...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58450&amp;title=solved-using-beforedrawrow-with-a-treecolum#58450</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 16687<br /><strong>Posted:</strong> 12 May 2010 at 3:16am<br /><br />Cheers Aaron...<br><br>I must admit that I never understood what you had meant about using the Metrics.<br><br>The addition of Metrics has enabled the colour to change immediately, however I have removed the redraw as this was causing the grid to slow down its response time immensely and is no longer required.&nbsp; <br><br><font color="#000099">Private Sub</font> rpcGrid_BeforeDrawRow(Index <font color="#000099">As Integer</font>, <font color="#000099">ByVal </font>Row <font color="#000099">As </font>XtremeReportControl.IReportRow, <font color="#000099">ByVal </font>Item <font color="#000099">As</font> XtremeReportControl.IReportRecordItem, <font color="#000099">ByVal </font>Metrics <font color="#000099">As </font>XtremeReportControl.IReportRecordItemMetrics)<br>&nbsp;&nbsp;&nbsp; <font color="#000099">If </font>Item.Index &gt; 0 <font color="#000099">Then</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#000099">If </font>IsNumeric(Item.Value) <font color="#000099">Then </font><font size="3" color="#ff0000"><strong>Metrics</strong></font>.ForeColor = IIf(<font color="#000099">CDbl</font>(Item.Value) &lt; 0, vbRed, vbBlack)<br>&nbsp;&nbsp;&nbsp; <font color="#000099">End If</font><br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <strike><font color="#ff0000">rpcGrid(Index).Redraw</font></strike><br><font color="#000099">End Sub</font><br><br>Thanks, this issue is now resolved!<br>]]>
   </description>
   <pubDate>Wed, 12 May 2010 03:16:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58450&amp;title=solved-using-beforedrawrow-with-a-treecolum#58450</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] Using BeforeDrawRow with a TreeColum : Hi,  You are right about the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58434&amp;title=solved-using-beforedrawrow-with-a-treecolum#58434</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 16687<br /><strong>Posted:</strong> 11 May 2010 at 2:22pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>You are right about the code you added (it's messy <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0">) If you just change code in BeforeDrawRow event,&nbsp;color will be immediately updated if you expand row.</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#000099>Private Sub</FONT> rpcGrid_BeforeDrawRow(Index <FONT color=#000099>As Integer</FONT>, <FONT color=#000099>ByVal </FONT>Row <FONT color=#000099>As </FONT>XtremeReportControl.IReportRow, <FONT color=#000099>ByVal </FONT>Item <FONT color=#000099>As</FONT> XtremeReportControl.IReportRecordItem, <FONT color=#000099>ByVal </FONT>Metrics <FONT color=#000099>As </FONT>XtremeReportControl.IReportRecordItemMetrics)<BR>&nbsp;&nbsp;&nbsp; <FONT color=#000099>If </FONT>Item.Index &gt; 0 <FONT color=#000099>Then</FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000099>If </FONT>IsNumeric(Item.Value) <FONT color=#000099>Then </FONT><FONT color=#ff0000 size=3><strong>Metrics</strong></FONT>.ForeColor = IIf(<FONT color=#000099>CDbl</FONT>(Item.Value) &lt; 0, vbRed, vbBlack)<BR>&nbsp;&nbsp;&nbsp; <FONT color=#000099>End If</FONT><BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; rpcGrid(Index).Redraw<BR><FONT color=#000099>End Sub<BR></FONT></DIV><DIV><FONT color=#000099></FONT>&nbsp;</DIV><DIV><FONT color=#000099><FONT color=#000000><strong>As I said before: Metrics object will be updated immediately</strong> <strong>and "Item" and "Row" parameters will take effect only on <EM><FONT size=3>next </FONT>redraw</EM>.&nbsp;</strong></FONT></FONT></DIV><DIV><FONT color=#000099><strong><FONT color=#000000></FONT></strong></FONT>&nbsp;</DIV><DIV><FONT color=#000099>&nbsp;</DIV></FONT>]]>
   </description>
   <pubDate>Tue, 11 May 2010 14:22:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58434&amp;title=solved-using-beforedrawrow-with-a-treecolum#58434</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] Using BeforeDrawRow with a TreeColum : Hi Aaron,Thanks for the quick...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58423&amp;title=solved-using-beforedrawrow-with-a-treecolum#58423</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 16687<br /><strong>Posted:</strong> 11 May 2010 at 2:52am<br /><br />Hi Aaron,<br><br>Thanks for the quick response, I did try the .Caption but this didn't help.<br><br>I had seen that the BeforeDrawRow fires before the row is made visible, therefore I changed the code to use the following DrawItem event as this fires after the rows are made visible:<br><br><font color="#000099">Private Sub</font> rpcGrid_DrawItem(Index <font color="#000099">As Integer</font>, <font color="#000099">ByVal </font>Row <font color="#000099">As </font>XtremeReportControl.IReportRow, <font color="#000099">ByVal </font>Column <font color="#000099">As </font>XtremeReportControl.IReportColumn, <font color="#000099">ByVal </font>Item <font color="#000099">As </font>XtremeReportControl.IReportRecordItem, <font color="#000099">ByVal </font>hDC <font color="#000099">As </font>stdole.OLE_HANDLE, <font color="#000099">ByVal </font>left <font color="#000099">As </font><font color="#000099">Long</font>, <font color="#000099">ByVal </font>top <font color="#000099">As </font><font color="#000099">Long</font>, <font color="#000099">ByVal </font>right <font color="#000099">As </font><font color="#000099">Long</font>, <font color="#000099">ByVal </font> bottom <font color="#000099">As Long</font>, DoDefault <font color="#000099">As Boolean</font>)<br>&nbsp;&nbsp;&nbsp; <font color="#000099">If </font>Item.Index &gt; 0 <font color="#000099">Then</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#000099">If </font>IsNumeric(Item.Value) <font color="#000099">Then </font>Item.ForeColor = IIf(<font color="#000099">CDbl</font>(Item.Value) &lt; 0, vbRed, vbBlack)<br>&nbsp;&nbsp;&nbsp; <font color="#000099">End If</font><br><font color="#000099">End Sub</font><br><br><font color="#000099">Private Sub</font> rpcGrid_RowExpanded(Index <font color="#000099">As </font><font color="#000099">Integer</font>, <font color="#000099">ByVal </font>Row <font color="#000099">As </font>XtremeReportControl.IReportRow)<br>&nbsp;&nbsp;&nbsp; rpcGrid(Index).Redraw<br><font color="#000099">End Sub</font><br><br>This still doesn't cause the ReportControl to update the colours.<br><br>I did however try the following, which is a bit messy but works...<br><br><font color="#000099">Private Sub</font> rpcGrid_RowExpanded(Index <font color="#000099">As </font><font color="#000099">Integer</font>, <font color="#000099">ByVal </font>Row <font color="#000099">As </font>XtremeReportControl.IReportRow)<br>&nbsp;&nbsp;&nbsp; LockWindowUpdate Me.hWnd<br>&nbsp;&nbsp;&nbsp; rpcGrid(Index).ShowHeader = <font color="#000099">False</font><br>&nbsp;&nbsp;&nbsp; DoEvents<br>&nbsp;&nbsp;&nbsp; rpcGrid(Index).ShowHeader = <font color="#000099">True</font><br>&nbsp;&nbsp;&nbsp; LockWindowUpdate 0&amp;<br><font color="#000099">End Sub</font><br><br>The above code made the ReportControl update correctly, however it is like I said... a bit messy!<br>]]>
   </description>
   <pubDate>Tue, 11 May 2010 02:52:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58423&amp;title=solved-using-beforedrawrow-with-a-treecolum#58423</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] Using BeforeDrawRow with a TreeColum : Hi,   I would expect update...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58408&amp;title=solved-using-beforedrawrow-with-a-treecolum#58408</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 16687<br /><strong>Posted:</strong> 10 May 2010 at 11:11am<br /><br />Hi, <DIV>&nbsp;</DIV><DIV>I would expect update whenever RC needs to be updated (mouseclicks, scrolling etc. etc.) So expanding means you clicked in RC area and RC will fire BeforeDrawRow events for every single (<strong>visible</strong>) row. </DIV><DIV>&nbsp;</DIV><DIV>You can try this:</DIV><DIV>&nbsp;</DIV><OL><LI>Use .Caption instead of .Value in BeforeDrawRow event <LI>In RowExpanded event add Me.rpcGrid.Redraw <LI>Use Metrics object to change visual effects *</LI></OL><P><strong>* Note:&nbsp;You have to change Metrics parameter to have immediate effect. Changing "Item" and "Row" parameters will take effect only on <EM><FONT color=#0000ff>next redraw</FONT></EM>.</strong>&nbsp;</P><P>If this doesn't work for you: Is it possible to create test project or show code what you did?</P><DIV></DIV>]]>
   </description>
   <pubDate>Mon, 10 May 2010 11:11:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58408&amp;title=solved-using-beforedrawrow-with-a-treecolum#58408</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] Using BeforeDrawRow with a TreeColum :   Hi,I am using the ReportControl...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58405&amp;title=solved-using-beforedrawrow-with-a-treecolum#58405</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 16687<br /><strong>Posted:</strong> 10 May 2010 at 10:13am<br /><br />Hi,<br><br>I am using the ReportControl to display data in a TreeColumn style, as many of the columns display negative numbers I have added the "BeforeDrawRow" event which is as follows:<br><br><font color="#000099">Private Sub</font> rpcGrid_BeforeDrawRow(Index <font color="#000099">As Integer</font>, <font color="#000099">ByVal </font>Row <font color="#000099">As </font>XtremeReportControl.IReportRow, <font color="#000099">ByVal </font>Item <font color="#000099">As</font> XtremeReportControl.IReportRecordItem, <font color="#000099">ByVal </font>Metrics <font color="#000099">As </font>XtremeReportControl.IReportRecordItemMetrics)<br>&nbsp;&nbsp;&nbsp; <font color="#000099">If </font>Item.Index &gt; 0 <font color="#000099">Then</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#000099">If </font>IsNumeric(Item.Value) <font color="#000099">Then </font>Item.ForeColor = IIf(<font color="#000099">CDbl</font>(Item.Value) &lt; 0, vbRed, vbBlack)<br>&nbsp;&nbsp;&nbsp; <font color="#000099">End If</font><br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; rpcGrid(Index).Redraw<br><font color="#000099">End Sub<br><br><font color="#000000">This works for the Rows being displayed by default, but once you expand the Tree column by clicking on the plus icon the grid does not update the colours. I did notice however that the grid updates once the row has been expanded and I click on the grid, this seems to update the colours or by moving the mouse over the grid column headers. But I need this to display the colours when the rows are expanded by default.<br><br>Is there a better method for forcing a refresh of the ReportControl after using the </font></font>"BeforeDrawRow" event.<br><font color="#000099"><font color="#000000"><br><br></font></font> ]]>
   </description>
   <pubDate>Mon, 10 May 2010 10:13:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16687&amp;PID=58405&amp;title=solved-using-beforedrawrow-with-a-treecolum#58405</guid>
  </item> 
 </channel>
</rss>