-
June 18th, 2010, 06:15 AM
#1
double header in a CListCtrl
Hello
i try to add two lines of header in a CListCtrl, is there a modified CListCtrl to do this ?
For instance, i would like to have this
Code:
| zone 1 |
| zone 2 | zone 3 |
----------------------------------------------
| 123 | 456 |
-----------------------------------------------
thanks in advanced for your answers
-
June 18th, 2010, 06:59 AM
#2
Re: double header in a CListCtrl
Have a look at Listcontrol grouping.
http://www.codeproject.com/KB/list/C..._Grouping.aspx
You can't have 2 different columnheaders if that's what you want, that'll need 2 listcontrols.
-
June 21st, 2010, 06:17 AM
#3
Re: double header in a CListCtrl
that's not exatly what i need, here the data are grouped on header, i only want to display data like this
Code:
| zone 1 |
| zone 2 | zone 3 |
----------------------------------------------
| 123 | 456 |
-----------------------------------------------
-
October 26th, 2010, 03:08 AM
#4
Re: double header in a CListCtrl
sorry for the up, but i really need an answer
-
October 26th, 2010, 04:23 AM
#5
Re: double header in a CListCtrl
Originally Posted by mumuri
sorry for the up, but i really need an answer
You already got an answer from OReubens (more than four months ago):
Originally Posted by OReubens
If you however don't believe it is impossible - why didn't you try to search for it in http://www.codeproject.com/KB/list/#Header+Controls or/and http://www.codeguru.com/cpp/controls...headercontrol/
Victor Nijegorodov
-
October 27th, 2010, 07:02 AM
#6
Re: double header in a CListCtrl
A CListCtrl is a "common control" it's a generic type control that's suitable for problems that fit into what it is designed to do. It can't solve all problems, and what you're asking is something it doesn't.
So I stand by my answer that a CListctrl can't do what you're asking.
What you ask will need a custom control (= you do all of the input and painting yourself). Depending on the details of what you need it may be possible to get it to work with just substituting (subclassing) the headercontrol in the listcontrol, although personal experience in that field would have me believe that this rarely works out. You'll probably will need to have a full custom list.
You could search around if someone has already made the type of control you need. it could require purchasing a library though.
-
October 27th, 2010, 07:17 AM
#7
Re: double header in a CListCtrl
Originally Posted by mumuri
sorry for the up, but i really need an answer
I don't even understand how that would work. Looks like the columns wouldn't look like the header.
You may be able to achieve something like that with a tab control, but I can't tell for sure what your objective is.
-
October 27th, 2010, 10:35 AM
#8
Re: double header in a CListCtrl
if I understand it right, he wants 'column groups'.
so on the first row of the coolumns you would have something like
Europe, America, Asia, Africa
and on the 2nd row of the columns you would have a further subdivision of the 1st row.
So the 'Europe' would be further divided into: Belgium, France, Germany, Italy, Portugal, Spain, ...
America would be divided in: Canada, Mexico, United states, ...
Asia: China, Japan, India, ...
Africa: Kenia, Egypt, Morrocco, congo, ...
While I have seen this approach before (on websites), I can't recall ever having seen this type of interface in a UI. where you can actually change the column widths etc.
My gut feeling when I hear someone asking for these "awkward" / "unusual" types of controls is that you're probably much better off refactoring the problem so it fits into the usual type of controls, rather than confront your users with new types of controls they don't know how to use.
Not that custom controls of any and all kind are bad, some are actually very necessary, particularly if it translates well to how users are used to working (when translating a phisical device into a UI) but the truth behind it is that they're often a LOT of work to write, and a lot of work to maintain having proper visual appearance as new versions of windows get released.
Last edited by OReubens; October 27th, 2010 at 10:41 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|