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.
Printable View
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.
Quote:
Originally Posted by ADSOFT
why don't you store the variable in a file and access it whenever you need it?
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.
Quote:
Originally Posted by ADSOFT
i don't really understand...can you be more specific?
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.Quote:
Originally Posted by ADSOFT
Way to go. That is the reason the item data is there. ..Quote:
Originally Posted by mike200
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
Quote:
Originally Posted by mike200
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.Quote:
Originally Posted by ADSOFT