<?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 : CXTListCtrl With Sort Question</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTListCtrl With Sort Question]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 07:32:48 +0000</pubDate>
  <lastBuildDate>Sun, 07 Oct 2007 03:58:23 +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=8331</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[CXTListCtrl With Sort Question : hi!  I use CXTListCtrl in a dialogue,and...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8331&amp;PID=27043&amp;title=cxtlistctrl-with-sort-question#27043</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3334">hiaward</a><br /><strong>Subject:</strong> 8331<br /><strong>Posted:</strong> 07 October 2007 at 3:58am<br /><br />hi!<DIV>&nbsp;&nbsp;&nbsp; I use CXTListCtrl in a dialogue,and subclass&nbsp;the CXTHeaderCtrl,but when i right click on the head ,then select any sort&nbsp;menu ,it can not work.btw,when i left click on the head,it can work very nice.</DIV><DIV>&nbsp;&nbsp;&nbsp; I dubuged the code,and found&nbsp;that when i right click ,it can not go to CTest_AllDlg::OnNotify message.why??</DIV><DIV>&nbsp;&nbsp;&nbsp; I use v9.60.thanks.</DIV><DIV>&nbsp;</DIV><DIV>void CTest_AllDlg::InitList()<BR>{<BR>&nbsp;//m_CtlList.SetExtendedStyle(LVS_ALIGNLEFT |LVS_EX_HEADERDRAGDROP |LVS_EX_FULLROWSELECT |LVS_EX_TRACKSELECT |LVS_EX_CHECKBOXES);<BR>&nbsp;m_CtlList.BuildColumns(_countof(_Proc_nColWidth),_Proc_nColWidth,_Proc_nFieldName);<BR>&nbsp;<BR>&nbsp;this-&gt;LoadList();</DIV><DIV>&nbsp;HWND hWndHeader = m_CtlList.GetDlgItem(0)-&gt;GetSafeHwnd();<BR>&nbsp;m_header.SubclassWindow(hWndHeader);</DIV><DIV>&nbsp;m_header.EnableAutoSize(TRUE);<BR>&nbsp;m_header.ResizeColumnsToFit();<BR>&nbsp;SortColumn(m_nSortedCol, m_bAscending);</DIV><DIV>&nbsp;m_CtlList.ModifyExtendedStyle(0, LVS_EX_FULLROWSELECT|LVS_EX_FULLROWSELECT);<BR>&nbsp;m_CtlList.EnableUserSortColor(TRUE);</DIV><DIV>&nbsp;m_header.SetTheme(new CXTHeaderThemeOffice2003());<BR>&nbsp;CXTPPaintManager::SetTheme(xtpThemeOffice2003);<BR>&nbsp;<BR>&nbsp;CXTHeaderTheme* pTheme = m_header.GetTheme();<BR>&nbsp;if(pTheme)<BR>&nbsp;{<BR>&nbsp;&nbsp;pTheme-&gt;SetDrawStyle(XTTHEME_SORTARROW|XTTHEME_HOTTRACKING,&amp;m_header);<BR>&nbsp;&nbsp;EnableControls();<BR>&nbsp;}<BR>}</DIV><DIV>&nbsp;</DIV><DIV>void CTest_AllDlg::LoadList()<BR>{<BR>&nbsp;m_CtlList.InsertItem(0,NULL,0);&nbsp;<BR>&nbsp;m_CtlList.SetItemText(0,0,"1");<BR>&nbsp;m_CtlList.SetItemText(0,1,"a");</DIV><DIV>&nbsp;m_CtlList.InsertItem(1,NULL,0);&nbsp;<BR>&nbsp;m_CtlList.SetItemText(1,0,"2");<BR>&nbsp;m_CtlList.SetItemText(1,1,"b");</DIV><DIV>&nbsp;m_CtlList.InsertItem(2,NULL,0);&nbsp;<BR>&nbsp;m_CtlList.SetItemText(2,0,"3");<BR>&nbsp;m_CtlList.SetItemText(2,1,"c");</DIV><DIV>&nbsp;m_CtlList.InsertItem(3,NULL,0);&nbsp;<BR>&nbsp;m_CtlList.SetItemText(3,0,"4");<BR>&nbsp;m_CtlList.SetItemText(3,1,"d");<BR>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>BOOL CTest_AllDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)<BR>{<BR>&nbsp;HD_NOTIFY *pHDNotify = (HD_NOTIFY*)lParam;</DIV><DIV>&nbsp;if(pHDNotify-&gt;hdr.code == HDN_ITEMCLICKA ||<BR>&nbsp;&nbsp;pHDNotify-&gt;hdr.code == HDN_ITEMCLICKW)<BR>&nbsp;{<BR>&nbsp;&nbsp;if (pHDNotify-&gt;iItem == m_nSortedCol)<BR>&nbsp;&nbsp;&nbsp;SortColumn(pHDNotify-&gt;iItem, !m_bAscending);<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;SortColumn(pHDNotify-&gt;iItem, BoolType(m_header.GetAscending()));<BR>&nbsp;}</DIV><DIV>&nbsp;return CXTResizeDialog::OnNotify(wParam, lParam, pResult);<BR>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>void CTest_AllDlg::SortColumn(int iCol,bool bAsc)<BR>{<BR>&nbsp;m_bAscending = bAsc;<BR>&nbsp;m_nSortedCol = iCol;</DIV><DIV>&nbsp;// set sort image for header and sort column.<BR>&nbsp;m_CtlList.SetSortImage(m_nSortedCol,m_bAscending);</DIV><DIV>&nbsp;CXTSortClass csc(&amp;m_CtlList,m_nSortedCol);<BR>&nbsp;switch(m_nSortedCol)<BR>&nbsp;{<BR>&nbsp;case 0:<BR>&nbsp;&nbsp;csc.Sort(m_bAscending,xtSortInt);<BR>&nbsp;&nbsp;break;<BR>&nbsp;case 1:<BR>&nbsp;&nbsp;csc.Sort(m_bAscending,xtSortString);<BR>&nbsp;&nbsp;break;<BR>&nbsp;default:<BR>&nbsp;&nbsp;break;<BR>&nbsp;}<BR>}</DIV>]]>
   </description>
   <pubDate>Sun, 07 Oct 2007 03:58:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8331&amp;PID=27043&amp;title=cxtlistctrl-with-sort-question#27043</guid>
  </item> 
 </channel>
</rss>