Problem Grid/AddColumn

Moderator: Rathinagiri

Post Reply
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Problem Grid/AddColumn

Post 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
User avatar
gfilatov
Posts: 1057
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Problem Grid/AddColumn

Post 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:
Last edited by gfilatov on Thu Apr 08, 2010 1:57 pm, edited 1 time in total.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Problem Grid/AddColumn

Post 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.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Problem Grid/AddColumn

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply