CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2004
    Posts
    1,352

    LISTVIEW, hide a column

    Is there a way to hide a column in a listview. I want to store a variable in a column. The ListView would be perfict if it could hide a column.

  2. #2
    Join Date
    Feb 2002
    Posts
    3,788

    Re: LISTVIEW, hide a column

    Quote Originally Posted by ADSOFT
    Is there a way to hide a column in a listview. I want to store a variable in a column. The ListView would be perfict if it could hide a column.

    why don't you store the variable in a file and access it whenever you need it?

  3. #3
    Join Date
    Jun 2004
    Posts
    1,352

    Re: LISTVIEW, hide a column

    Well I want to use the sorting features of ListView. I want to use the listview as a sorting mechanism that quickly returns me an index.

  4. #4
    Join Date
    Feb 2002
    Posts
    3,788

    Re: LISTVIEW, hide a column

    Quote Originally Posted by ADSOFT
    Well I want to use the sorting features of ListView. I want to use the listview as a sorting mechanism that quickly returns me an index.

    i don't really understand...can you be more specific?

  5. #5
    Join Date
    Apr 2000
    Location
    Boston
    Posts
    124

    Re: LISTVIEW, hide a column

    Quote Originally Posted by ADSOFT
    Well I want to use the sorting features of ListView. I want to use the listview as a sorting mechanism that quickly returns me an index.
    Instead of a hidden column, could you use CListCtrl::SetItemData to store the variable? Then in your CompareFunc do your comparison based on the item data.

  6. #6
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: LISTVIEW, hide a column

    Quote Originally Posted by mike200
    Instead of a hidden column, could you use CListCtrl::SetItemData to store the variable? Then in your CompareFunc do your comparison based on the item data.
    Way to go. That is the reason the item data is there. ..

  7. #7
    Join Date
    Jun 2004
    Posts
    1,352

    Re: LISTVIEW, hide a column

    Well let say I read a fixed record length file while filtering out some records. Now I would like to store the record number some where. If I place several fields of the filtered records in the listview then the end user can sort on any of the fields (i.e. a feature of listview). Upon getting the record in question from the view, I can quicly grab more inffo from that record by reading the file. In otherwords I want to use the listview as a way to store an index to the record number yet be able to sort on

  8. #8
    Join Date
    Jun 2004
    Posts
    1,352

    Re: LISTVIEW, hide a column

    Quote Originally Posted by mike200
    Instead of a hidden column, could you use CListCtrl::SetItemData to store the variable? Then in your CompareFunc do your comparison based on the item data.

    Thanks,

    If it doesn't display the value it will do the job. Is that the case?


    TIA

  9. #9
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: LISTVIEW, hide a column

    Quote Originally Posted by ADSOFT
    Thanks,
    If it doesn't display the value it will do the job. Is that the case?
    TIA
    Yes. It is just like storing additional info with each item. The info can be anything and it is upto you to decide what it is. Only , you just cast it to a DWORD when you set it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured