Page 1 of 1

Grid

Posted: Mon Jan 18, 2021 2:49 pm
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

Re: Grid

Posted: Mon Jan 18, 2021 4:42 pm
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

Re: Grid

Posted: Mon Jan 18, 2021 5:20 pm
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

Re: Grid

Posted: Mon Jan 18, 2021 7:02 pm
by tonton2
it's good I found it, thank you all

Re: Grid

Posted: Tue Jan 19, 2021 12:05 am
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)}