Getting the number of columns in the report view


To get the number of columns in the list view control, we first get a pointer to the header control and then use the header control to query the number of columns it has.
CHeaderCtrl* pHeader = (CHeaderCtrl*) m_listctrl.GetDlgItem(0);
int nColumnCount = pHeader->GetItemCount();
This works even when the listview control has the LVS_NOCOLUMNHEADER style. It also works if the control is not in the report view.
 



Comments

  • Trade Rumor : chanel Described as An Absolute Must This morning

    Posted by incockDak on 03/29/2013 08:03am

    This is why everyone is extremely wrong surrounding gucci and consequently reasons why you have to ought to see this ebook. [url=http://growth-management.alachua.fl.us/comprehensive_planning/gucci.html]バック[/url] Different questions about gucci clarified and reasons why you has got to read in detail each concept of this specific documentation. [url=http://growth-management.alachua.fl.us/comprehensive_planning/saclongchamp.php]Sacs longchamp[/url] WuqGdqQheSqa [url=http://running-nike0.seesaa.net/]nike ランニング[/url]ZtzJanPmaDop [[url=http://free-nike-nikeo.seesaa.net/]nike free[/url]UbrPdlBbiClp [url=http://xn--nike-ul4c5c5fyqb.seesaa.net/]ナイキスニーカー[/url]GqpUvrLhnEpo [url=http://nikejapan0.seesaa.net/]ナイキスニーカー[/url]LlpXkoBeoUqp [url=http://nikesneakersjp.seesaa.net/]nike スニーカー[/url]HxkKocIszLps [url=http://nikegolf00.seesaa.net/]ナイキゴルフ[/url]GfqAaqKcwKrt [url=http://nikeshoes00.seesaa.net/]シューズナイキ[/url]ZkvTscAlfWns [url=http://sneaker-adidas-jp.seesaa.net/]スニーカー アディダス[/url]DjqEynIeyEry

    Reply
  • Just stop Complaining And Start your private nike shoes Distribution campaign Preferably

    Posted by expopmerm on 03/18/2013 01:54am

    The 12 MostWild adidas shoes Secrets and cheats... And The Way To Utilize them!!|Concise guide helps you with the ins and outs linked with nike shoes combined with things you want to undertake this afternoon.}[url=http://www.nikejapan.asia/]nike air[/url] Understand who's preaching about nike shoes and exactly why you ought to get worried. [url=http://www.adidasjapan.biz/]スニーカー adidas[/url] adidas shoes will give spanking new life span to the old dilemma. . . defacto standard The way in which gucci bags Made Me Famous And Rich [url=http://www.guccijp.asia/]gucci バッグ[/url] The best tool for chloe which you may understand about right away. [url=http://www.chloejp.biz/]財布 chloe[/url] The Amazing chanel bags Hack Who Can Fool Almost all [url=http://www.chaneljp.biz/]chanel バッグ[/url] Information on how to learn all the stuff there is to understand surrounding chanel in nine straight forward steps.The reasons why so many people are dead wrong regarding adidas shoes and as a result why you should certainly check this out post. [url=http://www.adidasjapan.asia/]adidas シューズ[/url] Whoa, amazing service. You must have a look at adidas shoes right now while it's still up for grabs ! ! [url=http://www.nikejp.biz/]nike running[/url] adidas shoes Counterfeits - A Really Wonderful nike shoes 'cheat' That experts claim Fools 97% of the customers

    Reply
  • A valid pointer to CHeaderCtrl object

    Posted by Legacy on 11/26/2003 12:00am

    Originally posted by: Mirko

    Work with the windows handle of class CHeaderCtrl to retrieve a valid pointer if the header window exists.
    // The pointer to my list control.
    extern CListCtrl* pMyListControl;

    // ThePointer to my header control
    CHeaderCtrl* pHeader = NULL;

    HWND hwndList = 0;
    HWND hwndHeader = 0;

    hwndList = pMyListControl->GetSafeHwnd();
    hwndHeader = ListView_GetHeader(hwndList); //macro use
    pHeader = (CHeaderCtrl*)FromHandle(hwndHeader);
    if(pHeader)
    int nColumnCount = pHeader->GetItemCount();

    Reply
  • Use GetHeaderCtrl

    Posted by Legacy on 11/06/2001 12:00am

    Originally posted by: Joost van den Boom

    Instead of using "m_listctrl.GetDlgItem(0)" use "m_listctrl.GetHeaderCtrl()" then it works fine!

    Joost

    Reply
  • Wrong number of columns.

    Posted by Legacy on 05/17/2000 12:00am

    Originally posted by: Alon

    I used this code to find out the numbers of columns I have in order to delete them. I got wrong number and I made the deletion in that way:
    
    

    while(m_ListCtrl.DeleteColumn(0) != 0);

    In that way I didn't have any problem!

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

  • The first phase of API management was about realizing the business value of APIs. This next wave of API management enables the hyper-connected enterprise to drive and scale their businesses as API models become more complex and sophisticated. Today, real world product launches begin with an API program and strategy in mind. This API-first approach to development will only continue to increase, driven by an increasingly interconnected web of devices, organizations, and people. To support this rapid growth, …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds