<?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 : ListView Sorting</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : ListView Sorting]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 15:31:45 +0000</pubDate>
  <lastBuildDate>Thu, 29 Apr 2010 12:32:25 +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=14513</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[ListView Sorting :   ampcom wrote:Thanks to both...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58275&amp;title=listview-sorting#58275</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 14513<br /><strong>Posted:</strong> 29 April 2010 at 12:32pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by ampcom" alt="Originally posted by ampcom" style="vertical-align: text-bottom;" /> <strong>ampcom wrote:</strong><br /><br />Thanks to both of you, the example above works great - however the article has also solved another problem and is worth a read. <DIV>&nbsp;</DIV><DIV>Regards</DIV><DIV>&nbsp;</DIV><DIV>Tony</DIV><DIV>&nbsp;</DIV></td></tr></table> <DIV>&nbsp;</DIV><DIV>Hi,</DIV><DIV>&nbsp;</DIV><DIV>Did one of you ever used CJ ReportControl or ever try to use it? For me it was an easy decision to replace (in my case) MS Listview&nbsp;with CJ ReportControl. I don't have code to sort numeric values, it's sorted just by a click <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0">&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Just an idea...</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 29 Apr 2010 12:32:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58275&amp;title=listview-sorting#58275</guid>
  </item> 
  <item>
   <title><![CDATA[ListView Sorting : Thanks to both of you, the example...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58264&amp;title=listview-sorting#58264</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4561">ampcom</a><br /><strong>Subject:</strong> 14513<br /><strong>Posted:</strong> 28 April 2010 at 3:20pm<br /><br />Thanks to both of you, the example above works great - however the article has also solved another problem and is worth a read.<DIV>&nbsp;</DIV><DIV>Regards</DIV><DIV>&nbsp;</DIV><DIV>Tony</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 28 Apr 2010 15:20:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58264&amp;title=listview-sorting#58264</guid>
  </item> 
  <item>
   <title><![CDATA[ListView Sorting : Hello,  Here is a sample of...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58262&amp;title=listview-sorting#58262</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1646">dentor</a><br /><strong>Subject:</strong> 14513<br /><strong>Posted:</strong> 28 April 2010 at 12:53pm<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>Here is a sample of <strong>Sub ListView1_ColumnClick</strong> which demonstrate&nbsp;a way of sorting numeric (integer) or date value with Listview control.</DIV><DIV>&nbsp;</DIV><DIV>You save the older values in the Tag property, then put new formating values, do the sort, then put back the older values in the items.</DIV><DIV>The sample is for Numeric values in column 3 and date values in column 4</DIV><DIV>You can complete the sub to sort others types of values.</DIV><DIV>&nbsp;</DIV><DIV>------------------------------------------------------------------------------------------------------------------------------------</DIV><DIV>Private Sub ListView1_ColumnClick(ByVal ColumnHeader As XtremeSuiteControls.ListViewColumnHeader)<BR>Dim Item As ListViewItem</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; ' *** Numeric integer value in column 3<BR>&nbsp;&nbsp;&nbsp; ' *** Date value in column 4<BR>&nbsp;&nbsp;&nbsp; If ColumnHeader.Index = 3 Or ColumnHeader.Index = 4 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each Item In Liste.ListItems<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Item.ListSubItems(ColumnHeader.Index - 1).Tag = Item.SubItems(ColumnHeader.Index - 1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case ColumnHeader.Index<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case 3<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Item.SubItems(2) = right$(String$(12, "0") &amp; Trim$(Item.ListSubItems(2)), 12)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case 4<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Item.SubItems(3) = Format$(right$(Item.ListSubItems(3), 10), "yyyymmdd")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next Item<BR>&nbsp;&nbsp;&nbsp; End If</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; With ListView1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .SortKey = ColumnHeader.Index - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Sorted = True<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .SortOrder = 1 Xor .SortOrder<BR>&nbsp;&nbsp;&nbsp; End With<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; ' *** Put the value back in column 3 and 4<BR>&nbsp;&nbsp;&nbsp; If ColumnHeader.Index = 3 Or ColumnHeader.Index = 4 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each Item In ListView1.ListItems<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Item.SubItems(ColumnHeader.Index - 1) = Item.ListSubItems(ColumnHeader.Index - 1).Tag<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next Item<BR>&nbsp;&nbsp;&nbsp; End If<BR>End Sub</DIV><DIV>-----------------------------------------------------------------------------------------------------------------------------</DIV><DIV>&nbsp;</DIV><DIV>Hoping it will help you.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 28 Apr 2010 12:53:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58262&amp;title=listview-sorting#58262</guid>
  </item> 
  <item>
   <title><![CDATA[ListView Sorting : Since our control is derived form...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58255&amp;title=listview-sorting#58255</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 14513<br /><strong>Posted:</strong> 28 April 2010 at 8:44am<br /><br />Since our control is derived form standard MFC control it also lacks the ability to sort dates and numbers, but here is a great article that shows you how to do it, or you can do the add a dummy column idea one person suggests at the bottom.<br><br>http://www.codeguru.com/vb/controls/vb_listview/article.php/c1669<br>]]>
   </description>
   <pubDate>Wed, 28 Apr 2010 08:44:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58255&amp;title=listview-sorting#58255</guid>
  </item> 
  <item>
   <title><![CDATA[ListView Sorting : Hi,  I am using the above example,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58242&amp;title=listview-sorting#58242</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4561">ampcom</a><br /><strong>Subject:</strong> 14513<br /><strong>Posted:</strong> 28 April 2010 at 2:13am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>I am using the above example, but I cannot get to work with numeric values, i.e. when sorting ASC&nbsp;10.21 will come before 9.21 - it seems to treat the columns as text values.</DIV><DIV>&nbsp;</DIV><DIV>Does anyone know how to fix?</DIV><DIV>&nbsp;</DIV><DIV>Regards</DIV><DIV>&nbsp;</DIV><DIV>Tony</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 28 Apr 2010 02:13:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=58242&amp;title=listview-sorting#58242</guid>
  </item> 
  <item>
   <title><![CDATA[ListView Sorting : Yo utyilizo el siguiente codigo:Private...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=55453&amp;title=listview-sorting#55453</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5743">stkPablo</a><br /><strong>Subject:</strong> 14513<br /><strong>Posted:</strong> 07 December 2009 at 7:53pm<br /><br />Yo utyilizo el siguiente codigo:<br><br>Private Sub List_ColumnClick(ByVal ColumnHeader As XtremeSuiteControls.ListViewColumnHeader)<br>&nbsp; List.SortKey = ColumnHeader.Index - 1<br>&nbsp; If List.SortOrder = 0 Then List.SortOrder = 1 Else List.SortOrder = 0<br>&nbsp; List.Sorted = True<br>End Sub<br><br>]]>
   </description>
   <pubDate>Mon, 07 Dec 2009 19:53:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=55453&amp;title=listview-sorting#55453</guid>
  </item> 
  <item>
   <title><![CDATA[ListView Sorting : I&amp;#039;m using the Xtreme Suite...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=49880&amp;title=listview-sorting#49880</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5320">jgordon428</a><br /><strong>Subject:</strong> 14513<br /><strong>Posted:</strong> 11 June 2009 at 2:46pm<br /><br />I'm using the Xtreme Suite Controls activeX version 13.0. I have a listview in a VB6 form. Is there a built-in mechanism (or code sample out there) for sorting based on column header click? My lists contain a mixture of string, date, and numeric data, and I need it to sort correctly based on the datatype. I figure I can store a code for the sort type in the columnheader tag property, but I'm not sure where I can pass the sort routine the specific sort type that I would like. Any suggestions?<br><br>Thank you.<br>]]>
   </description>
   <pubDate>Thu, 11 Jun 2009 14:46:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14513&amp;PID=49880&amp;title=listview-sorting#49880</guid>
  </item> 
 </channel>
</rss>