Grid

Issues and Discussions related to Harbour

Moderator: Rathinagiri

Post Reply
User avatar
tonton2
Posts: 349
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 16 times
Been thanked: 17 times
Contact:

Grid

Post by tonton2 »

Change Grid to Browse :
I would like to change this example to grid to browse, thanks for your help

// Dynamic Display

bdDisplay_1 := { || This.CellValue }
bdDisplay_2 := { || HMG_UPPER(This.CellValue) }
bdDisplay_3 = { || This.CellValue }
bdDisplay_4 := { || This.CellValue }
bdDisplay_5 := { || This.CellValue }
bdDisplay_6 := { || This.CellValue }
bdDisplay_7 := { || This.CellValue }
bdDisplay_8 := { || This.CellValue }

// Grid Column Controls Definitions

aCtrl_1 := {'TEXTBOX','NUMERIC','999999'}
aCtrl_2 := {'TEXTBOX','CHARACTER'}
aCtrl_3 := {'TEXTBOX','NUMERIC','99999999.99'}
aCtrl_4 := {'TEXTBOX','NUMERIC','99999999.99'}
aCtrl_5 := {'TEXTBOX','NUMERIC','99999999.99'}
aCtrl_6 := {'TEXTBOX','NUMERIC','99999999.99'}
aCtrl_7 := {'TEXTBOX','NUMERIC','99999999.99'}
aCtrl_8 := {'TEXTBOX','NUMERIC','9999999.99'}
@ 10,10 GRID Grid_Creance ;
WIDTH 770 ;
HEIGHT 440 ;
HEADERS {'Code ','Noms','RESTE','Prix Total','T.V.A ','Avances','Autre Av','Represent.'} ;
WIDTHS {70,200,90,90,90,90,90,90};
VALUE { 1 , 1 } ;
justify {0,0,1,1,1,1,1,1};
COLUMNCONTROLS { aCtrl_1 , aCtrl_2 , aCtrl_3 , aCtrl_4 , aCtrl_5 , aCtrl_6, aCtrl_7, aCtrl_8} ;
ON HEADCLICK { { ||Index_Code()},{ ||Index_NOM()} , {||Index_Reste()} ,{ || Index_PTotal()} } ;
ROWSOURCE "CREANC" ;
COLUMNFIELDS { 'CODE' , 'NOM' , 'Prix_Total+TUGP-Avance-Avancheq-Represent' , 'PRIX_TOTAL' , 'TUGP', 'AVANCE' , 'AVANCHEQ','REPRESENT' } ;
ALLOWAPPEND ;
ALLOWDELETE ;
DYNAMICDISPLAY { bdDisplay_1 , bdDisplay_2 , bdDisplay_3 , bdDisplay_4 , bdDisplay_5 , bdDisplay_6 ,bdDisplay_7,bdDisplay_8 } ;

CREANCE_1.Grid_Creance.ColumnDYNAMICFORECOLOR (3) := { WHITE} // BLACK}
CREANCE_1.Grid_Creance.ColumnDYNAMICBACKCOLOR (3) := {|| GREEN} // PURPLE}
Grand merci a vous
L'Algerie vous salut
Y.TABET

Red2
Posts: 118
Joined: Sat May 18, 2019 2:11 pm
DBs Used: DBF, FoxPro, Visual FoxPro
Location: United States (East Coast)
Has thanked: 60 times
Been thanked: 8 times

Post by Red2 »

Hi,

Am I correct that you are displaying a .DBF? If so you might start with the following differences:

Change property "ColumnFields" to property "Fields" using your old "ColumnFields" values
Change property "RowSource" to property "WorkArea" using your old RowSource value.

I am not aware that there is a Browse control-type property similar to Grid's ColumnControls.

In my opinion a Browse's display has some tradeoffs as compared to Grid.

I hope that this helps some.

Regards

User avatar
tonton2
Posts: 349
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 16 times
Been thanked: 17 times
Contact:

Post by tonton2 »

Red2 wrote:
Mon Jan 18, 2021 4:42 pm
Hi,

Am I correct that you are displaying a .DBF? If so you might start with the following differences:

Change property "ColumnFields" to property "Fields" using your old "ColumnFields" values
Change property "RowSource" to property "WorkArea" using your old RowSource value.

I am not aware that there is a Browse control-type property similar to Grid's ColumnControls.

In my opinion a Browse's display has some tradeoffs as compared to Grid.

I hope that this helps some.

Regards
"ColumnControls. " that's what I'm looking for
Thank you my friend
L'Algerie vous salut
Y.TABET

User avatar
tonton2
Posts: 349
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 16 times
Been thanked: 17 times
Contact:

Post by tonton2 »

it's good I found it, thank you all
L'Algerie vous salut
Y.TABET

franco
Posts: 576
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 34 times

Post by franco »

I use browse for lookups, grids for working with, mainly because of browsing larges files and speed.
I will be reposting my tbrowse example.
But to this, I found something interesting. I could use the following in a browse which has the word grid in them and they still worked
FC21 and so on are the fields sent by parameters. There may have been an easier way to display this but this works for JUSTIFY in a 5 field browse.

Code: Select all

JUSTIFY {IF(LEN(ALLTRIM(FC11))>0,(IF(VALTYPE(&FC11)<> 'N',GRID_JTFY_LEFT,GRID_JTFY_RIGHT)),NIL),;
			IF(LEN(ALLTRIM(FC21))>0,(IF(VALTYPE(&FC21)<> 'N',GRID_JTFY_LEFT,GRID_JTFY_RIGHT)),NIL),;
			IF(LEN(ALLTRIM(FC31))>0,(IF(VALTYPE(&FC31)<> 'N',GRID_JTFY_LEFT,GRID_JTFY_RIGHT)),NIL),;
			IF(LEN(ALLTRIM(FC41))>0,(IF(VALTYPE(&FC41)<> 'N',GRID_JTFY_LEFT,GRID_JTFY_RIGHT)),NIL),;
			IF(LEN(ALLTRIM(FC51))>0,(IF(VALTYPE(&FC51)<> 'N',GRID_JTFY_LEFT,GRID_JTFY_RIGHT)),NIL)}
All The Best,
Franco
Canada

Post Reply