Page 1 of 1

Problem Grid/AddColumn

Posted: Thu Apr 08, 2010 12:51 pm
by luisvasquezcl
Hola Roberto,
Encontré un problema en el metodo addcolumn del grid. Te adjunto un demo.
El problema se presenta cuando compilo, error de sintaxis . en la linea
Main.Grid_1.AddColumn(i,'Column_'+ALLTRIM(STR(i)), 80 )
Saludos cordiales,
Luis Vasquez.

#include <hmg.ch>

procedure inicio
load window Main
Main.Center
Main.Activate
RETURN

PROCEDURE LoadColumn
Main.Grid_1.DeleteColumn(1)
FOR i:= 1 TO 3
Main.Grid_1.AddColumn(i,'Column_'+ALLTRIM(STR(i)), 80)
NEXT
RETURN

PROCEDURE LoadData
FOR i:= 1 TO 10
Main.Grid_1.Additem({ 'Element_1', 'Element_2','Element_3' } )
NEXT
RETURN

Re: Problem Grid/AddColumn

Posted: Thu Apr 08, 2010 1:27 pm
by gfilatov
Hola Luis,

This method accepts a four parameters:

FormName.GridName.AddColumn( nColIndex , cCaption , nWidth , nJustify )

Try

Main.Grid_1.AddColumn(i,'Column_'+ALLTRIM(STR(i)), 80,0)

I hope that helps :idea:

Re: Problem Grid/AddColumn

Posted: Thu Apr 08, 2010 1:52 pm
by luisvasquezcl
Hi Grigory,
thanks for your help.
We must make a correction in the manual as it appears as optional
Justify value.
<ParentWindowName>. <ControlName>. AddColumn ([nColIndex] , [CCaption], [nWidth], [nJustify])
Best regards,
Luis Vasquez.

Re: Problem Grid/AddColumn

Posted: Sat Apr 10, 2010 10:36 pm
by Roberto Lopez
luisvasquezcl wrote:Hi Grigory,
thanks for your help.
We must make a correction in the manual as it appears as optional
Justify value.
<ParentWindowName>. <ControlName>. AddColumn ([nColIndex] , [CCaption], [nWidth], [nJustify])
Best regards,
Luis Vasquez.
Luis, Grigory:

Thanks.

I'll correct the reference ASAP.