GRID - COLOR

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

GRID - COLOR

Post by SALINETAS24 »

Hola, tengo un GRID que muestra los registros de una DBF y dependiendo del valor que tenga uno de ellos pinta el resultado de dicha celda de color. Funciona correctamente.. MENOS CUANDO ES EL PRIMER REGISTRO el que tiene que cambiar de color.
Como está seleccionado por el CURSOR muestra los standares de WINDONS y no consigo modificarlo y que la celda tome el color de la condición aunque esté seleccionada. Os paso el código, es muy simple.
Hay alguna posibilidad de que se aplique la condición al registro seleccionado en el GRID.

Muchas gracias.

---> Y en inglés según el Dr. Google he dicho :lol:

Hello, I have a GRID that shows the records of a DBF and depending on the value that one of them has, it paints the result of said color cell. It works correctly .. LESS WHEN IS THE FIRST RECORD the one that has to change color.
As it is selected by the CURSOR it shows the standards of WINDONS and I can not modify it and the cell takes the color of the condition even if it is selected. I pass the code to you, it's very simple.
There is some possibility that the condition applies to the record selected in the GRID.

Thank you very much.

Code: Select all

		fColor := { || if ( This.CellValue = 1 ,"",IF(This.CellValue = 2,GREEN,IF(This.CellValue = 3,YELLOW,RED ))) }
		
		@ 140,430 GRID grid_2									;
			WIDTH  300  											;
			HEIGHT 300 											;		
			HEADERS { "F.Servicio", "Cantidad","Estado" }		;
			WIDTHS { 100 , 100 ,100 }							;
			ROWSOURCE "LPEDIDOS"								;
			COLUMNFIELDS { "Fecha_Se" , "Cantidad" , "ESTADO"}  ;
			DYNAMICFORECOLOR { , ,fColor  } ;
			ON DBLCLICK Actual_Grid_2(aField, .F., @lNuevo, aTipos) ;
			DYNAMICDISPLAY	 {bdDisplay_1  ,bdDisplay_1  , bdDisplay_3  } 
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID - COLOR

Post by srvet_claudio »

See in one of the last demos of the grid:

- Set colors and display mode in GRID cell navigation mode:

CellNavigationColor ( _SELECTEDCELL_FORECOLOR, aRGBcolor )

CellNavigationColor ( _SELECTEDCELL_BACKCOLOR, aRGBcolor )

CellNavigationColor ( _SELECTEDCELL_DISPLAYCOLOR, lBoolean )


CellNavigationColor ( _SELECTEDROW_FORECOLOR, aRGBcolor )

CellNavigationColor ( _SELECTEDROW_BACKCOLOR, aRGBcolor )

CellNavigationColor ( _SELECTEDROW_DISPLAYCOLOR, lBoolean )


- Get colors in GRID cell navigation mode:

aRGBcolor := CellNavigationColor ( _SELECTEDCELL_FORECOLOR )

aRGBcolor := CellNavigationColor ( _SELECTEDCELL_BACKCOLOR )


aRGBcolor := CellNavigationColor ( _SELECTEDROW_FORECOLOR )

aRGBcolor := CellNavigationColor ( _SELECTEDROW_BACKCOLOR )
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply