Grid NoHeaders and NoColumnReSizing

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Grid NoHeaders and NoColumnReSizing

Post by Pablo César »

In another forum at PCToledo, they asked if there is conditions to remove header at runtime dynamically.

I found the way with this:

Code: Select all

#include <hmg.ch>

Function Main
DEFINE WINDOW Main AT 183 , 340 WIDTH 550 HEIGHT 350 TITLE "Remove Grid Headers / NoColumnReSizing" MAIN

    DEFINE GRID Grid_1
        ROW    70
        COL    190
        WIDTH  120
        HEIGHT 120
        ITEMS { {"111","222"} }
        VALUE 1
        WIDTHS {60, 80 }
        HEADERS {'AAA',"BBB"}
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        SHOWHEADERS .T.
        CELLNAVIGATION .F.
    END GRID
	
	DEFINE BUTTON Button_1
        ROW    250
        COL    100
        WIDTH  120
        HEIGHT 28
        ACTION HMG_ChangeWindowStyle ( GetControlHandle("Grid_1","Main"), LVS_NOCOLUMNHEADER, NIL, .F. )
        CAPTION "Remove Headers"
        FONTNAME "Arial"
        FONTSIZE 9
    END BUTTON
	
	DEFINE BUTTON Button_2
        ROW    250
        COL    280
        WIDTH  120
        HEIGHT 28
        ACTION HMG_ChangeWindowStyle ( GetControlHandle("Grid_1","Main"), LVS_REPORT, NIL, .T. )
        CAPTION "Fixed width Columns"
        FONTNAME "Arial"
        FONTSIZE 9
    END BUTTON

END WINDOW
Main.Center

// HMG_ChangeWindowStyle ( GetControlHandle("Grid_1","Main"), LVS_NOCOLUMNHEADER, NIL, .F. )

Main.Activate
Return Nil
The most interesting that I also found a way to let width columns fixed with no resizing.

I hope it could be useful for you.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Grid NoHeaders and NoColumnReSizing

Post by Pablo César »

Now I remember there is a dependency for calendars using grid and this will be useful in this:

viewtopic.php?p=31544#p31544
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: Grid NoHeaders and NoColumnReSizing

Post by Steed »

Thanks
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Grid NoHeaders and NoColumnReSizing

Post by mustafa »

Hola Pablo César
Muy buena solución:

Hace meses planteamos este proble en el Foro
que al no tener "nFreeze" como tiene TSbrowse

Mi pregunta es no Eliminar encabezados
e impidiento mover columnas

Mira el Post que montamos
varios compañeros aportando soluciones
con "SHOWHEADERS .F."

viewtopic.php?f=5&t=4610&hilit=mustafa

Pero no logramos Impedir Mover columnas sin Eliminar encabezado

Saludos

*--------------------------------------------- Google ----------------------------------------*

Hi Pablo César
Very good solution:

Months ago we raised this problem in the Forum
That when not having "nFreeze" as it has TSbrowse

My question is no delete headers
And impingement to move columns

Look at the Post we assemble
Several partners providing solutions
With "SHOWHEADERS .F."

viewtopic.php?f=5&t=4610&hilit=mustafa.

But we could not prevent moving columns without removing header

regards

Mustafa
Post Reply