<?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 : RESOLVED: Group By Clicked Column</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : RESOLVED: Group By Clicked Column]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 15 May 2026 16:33:36 +0000</pubDate>
  <lastBuildDate>Tue, 08 Jul 2008 14:06:14 +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=11349</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[RESOLVED: Group By Clicked Column : Very nice. Thank you!!  ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38003&amp;title=resolved-group-by-clicked-column#38003</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4315">JasonG</a><br /><strong>Subject:</strong> 11349<br /><strong>Posted:</strong> 08 July 2008 at 2:06pm<br /><br />Very nice. Thank you!!]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 14:06:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38003&amp;title=resolved-group-by-clicked-column#38003</guid>
  </item> 
  <item>
   <title><![CDATA[RESOLVED: Group By Clicked Column : There is a better solution...You...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38002&amp;title=resolved-group-by-clicked-column#38002</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 11349<br /><strong>Posted:</strong> 08 July 2008 at 2:04pm<br /><br />There is a better solution...You can use the SortOrder object to get the first column in the Sort Order and skip the API &amp; HitTest methods entirely:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Sub ReportControl1_SortOrderChanged()<br>&nbsp;&nbsp;&nbsp; With Me.ReportControl1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .GroupsOrder.DeleteAll<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .GroupsOrder.Add .SortOrder.Column(0)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Populate<br>&nbsp;&nbsp; End With<br>End Sub<br></pre></td></tr></table><br>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 14:04:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38002&amp;title=resolved-group-by-clicked-column#38002</guid>
  </item> 
  <item>
   <title><![CDATA[RESOLVED: Group By Clicked Column : I have a solution, but it seems...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38001&amp;title=resolved-group-by-clicked-column#38001</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 11349<br /><strong>Posted:</strong> 08 July 2008 at 2:01pm<br /><br />I have a solution, but it seems a little convoluted, so maybe there's a better way.<br><br>It appears the ColumnClick event doesn't fire when you click the header, but the SortOrderChanged event does. Problem is the SortOrderChanged event doesn't tell you what column was clicked, so you have to get the current cursor position, convert it to client coordinates and then get the column from the ReportControl HitTest method:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Type POINTAPI<br>&nbsp;&nbsp; x As Long<br>&nbsp;&nbsp; y As Long<br>End Type<br><br>Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long<br>Private Declare Function ScreenToClient Lib "user32.dll" (ByVal hwnd As Long, ByRef lpPoint As POINTAPI) As Long<br><br>Private Sub ReportControl1_SortOrderChanged()<br>&nbsp;&nbsp; Dim objHT As ReportHitTestInfo<br>&nbsp;&nbsp; Dim udtCursor As POINTAPI<br><br>&nbsp;&nbsp;&nbsp; With Me.ReportControl1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetCursorPos udtCursor<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ScreenToClient .hwnd, udtCursor<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set objHT = .HitTest(udtCursor.x, udtCursor.y)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Not objHT Is Nothing Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Not objHT.Column Is Nothing Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .GroupsOrder.DeleteAll<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .GroupsOrder.Add objHT.Column<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Populate<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp; End With<br>End Sub<br></pre></td></tr></table><br>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 14:01:32 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38001&amp;title=resolved-group-by-clicked-column#38001</guid>
  </item> 
  <item>
   <title><![CDATA[RESOLVED: Group By Clicked Column :    I am looking for some code...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38000&amp;title=resolved-group-by-clicked-column#38000</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4315">JasonG</a><br /><strong>Subject:</strong> 11349<br /><strong>Posted:</strong> 08 July 2008 at 1:45pm<br /><br />I am looking for some code that will sort AND group the report by the column clicked. When I initialize the form, I am setting a default grouping/sorting as shown here:<br><br><font face="Geneva, Arial, Helvetica, sans-serif" size="1">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Set Column = lstMessages.Columns.Add(3, "From", 130, True)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Set C = Column<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Set Column = lstMessages.Columns.Add(4, "First", 90, True)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Set Column = lstMessages.Columns.Add(5, "Last", 90, True)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Set Column = lstMessages.Columns.Add(6, "fullmessage", 90, True)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <u>lstMessages.GroupsOrder.Add C</u></font><br><br><br>The current code I have is below, however the desired affect is not occurring. Only the sorting is taking place... The original grouping is not removed, nor is the new one added.<br><br><font face="Geneva, Arial, Helvetica, sans-serif" size="1">&nbsp;&nbsp;&nbsp; Private Sub lstMessages_ColumnClick(ByVal Column As XtremeReportControl.IReportColumn)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lstMessages.GroupsOrder.DeleteAll<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lstMessages.GroupsOrder.Add Column<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lstMessages.Populate<br>&nbsp;&nbsp;&nbsp; End Sub</font><br>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 13:45:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11349&amp;PID=38000&amp;title=resolved-group-by-clicked-column#38000</guid>
  </item> 
 </channel>
</rss>