Page 1 of 2

MultiLine Grid Header

Posted: Sat Nov 12, 2016 2:53 pm
by Pablo César
As we know, this is not possible in our actual grid control.
MultiLine Grid Header.png
MultiLine Grid Header.png (7.82 KiB) Viewed 5073 times
Then reading at little bit more at: Multi-line (merged) datagridview header I saw this that it could interesting to be read:

Difference between datagridview and listview control :o

Whos knows this could let us to reach another proper results ? It could ? :?

Re: MultiLine Grid Header

Posted: Sat Nov 12, 2016 3:19 pm
by Rathinagiri
DataGridView is from Windows Forms (.Net) and not Win32 API.

I think it requires fundamental changes to HMG library.

MultiLine Grid Header

Posted: Sat Nov 12, 2016 3:35 pm
by Pablo César
Yes, I think so...

Thank you Rathi for your reply

Re: MultiLine Grid Header

Posted: Sat Nov 12, 2016 3:54 pm
by serge_girard
Nice idea Pablo, now I use labels to simulate this effect.
It works actually very fine, labelfont, color etc. is, of course, no problem.
You only have to keep them together..
Serge

Re: MultiLine Grid Header

Posted: Sat Nov 12, 2016 4:15 pm
by Rathinagiri
Serge,

Can you show me how?

MultiLine Grid Header

Posted: Sat Nov 12, 2016 4:47 pm
by Pablo César
There is something of curious in this demo (based on ..\SAMPLES\Controls\Grid\GRID_18).

I just over-wrote the 02.bmp file with larger size it simulates two lines.

When run the builded demo, enlarged image can diffusely be displayed. But when we go to first menu option (Change Column 1 Header Image) displays litle better but in column 1 and two. :?

The big question (most probably Claudio can gives his opinion & tip): Height of grid header, did not changed... :|

If we could control the height of the header by the size of the image, it would be more interesting to use HEADERIMAGES. :P

Re: MultiLine Grid Header

Posted: Sat Nov 12, 2016 4:52 pm
by serge_girard
Rathi, This is very simple and basic:

just put a LABEL at (for example) 10,10 and your GRID at 30,10 then. It's a bit dirty.
Then do the same for each column in the grid!

Serge

mol

Posted: Sat Nov 12, 2016 7:27 pm
by mol
My minigrid sample can be used for small number of rows. It uses labels so every cell can have different font, color etc.
One of limitations is that user can't change width of column.

mol

Posted: Sat Nov 12, 2016 7:39 pm
by Pablo César
mol wrote:One of limitations is that user can't change width of column.
Hi Marek, of course you can. By LISTVIEW_SETCOLUMNWIDTH C function.

You will find examples at:

viewtopic.php?p=38572#p38572
viewtopic.php?p=36639#p36639
viewtopic.php?p=17016#p17016

And at HMGDoc:

- New Set Properties:
 
            <ParentWindowName>.<GridControlName>.ColumnHEADER           ( nColIndex )  := cColumnHeader
            <ParentWindowName>.<GridControlName>.ColumnWIDTH            ( nColIndex )  := [ nColumnWidth ] |
                                                                                                                        [ GRID_WIDTH_AUTOSIZE ] |
                                                                                                                        [ GRID_WIDTH_AUTOSIZEHEADER ]

Re: MultiLine Grid Header

Posted: Sun Nov 13, 2016 7:48 am
by mol
I was writing about my minigrid based on labels