Page 1 of 3
Forecolor in grid displays the records alternating color
Posted: Wed Apr 21, 2010 5:55 pm
by jparada
Hi,
In a control grid (image attached, please take a look), the records are displayed alternating color, but how to implement that negative numbers are displayed in red, without losing the background color of alternating
Can someone please give me an advice about this implementation.
Thanks.
Best Regards
Javier
Re: Forecolor in grid displays the records alternating color
Posted: Wed Apr 21, 2010 6:42 pm
by Roberto Lopez
jparada wrote:Hi,
In a control grid (image attached, please take a look), the records are displayed alternating color, but how to implement that negative numbers are displayed in red, without losing the background color of alternating
Can someone please give me an advice about this implementation.
Thanks.
Best Regards
Javier
Code: Select all
English:
--------
Bug Reports:
Submit them to the bug report section according the following rules:
The bug report MUST include a DETAILED DESCRIPTION of the problem AND a simple
CODE SAMPLE (including all necessary files to get it run) showing it.
Besides that, you MUST indicate Windows and HMG versions used.
Español:
--------
Reportes de Bugs:
Por favor, enviarlos a la sección 'Bugs' del foro de acuerdo a las siguientes reglas:
El reporte DEBE incluir una DESCRIPCION DETALLADA del problema y un ejemplo simple que permita verificarlo incluyendo todos los archivos necesarios para poder compilarlo y ejecutarlo.
Además debe indicarse la versión de Windows y HMG utilizadas.
Re: Forecolor in grid displays the records alternating color
Posted: Wed Apr 21, 2010 7:01 pm
by jparada
Hi,
Roberto Thanks for answering, but unfortunately I do not understand your answer.
Here I am asking for something I do not know how to do it, I'm not reporting a bug, or maybe I do not understand the context of your response or maybe I was not very clear to my question.
Please let me know if my question I did not properly.
PS: Actually I'm wrong, I said a Grid control when I'm trying to do with a Browse control
Thanks
Best Regards
Javier
Re: Forecolor in grid displays the records alternating color
Posted: Wed Apr 21, 2010 8:17 pm
by Roberto Lopez
jparada wrote:Hi,
Roberto Thanks for answering, but unfortunately I do not understand your answer.
Here I am asking for something I do not know how to do it, I'm not reporting a bug, or maybe I do not understand the context of your response or maybe I was not very clear to my question.
Please let me know if my question I did not properly.
PS: Actually I'm wrong, I said a Grid control when I'm trying to do with a Browse control
Thanks
Best Regards
Javier
Sorry, I've misunderstood your message.
Look at the samples using DynamicForecolor.
Re: Forecolor in grid displays the records alternating color
Posted: Wed Apr 21, 2010 10:43 pm
by jparada
Hi,
Why if I do something like this:
Code: Select all
PRIVATE bckColor := { || If( OrdKeyNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) }
PRIVATE bckFore := { || If( OrdKeyNo() % 2 == 0, { 0,0,0 } , { 0,0,0 } ) }
FIELDS { "f_cve_art", "f_nomb_art", "Transform(g_existotal := ExistActual('01', Articulos->f_cve_art),'9999')" } ;
DYNAMICBACKCOLOR { bckColor, bckColor, bckColor } ;
DYNAMICFORECOLOR { bckFore , bckFore , If( g_existotal < 0, { 255,0,0 }, bckFore) } ;
This does not work.
And if I add a variable and do something like this:
Code: Select all
PRIVATE bckColor := { || If( OrdKeyNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) }
PRIVATE bckFore := { || If( OrdKeyNo() % 2 == 0, { 0,0,0 } , { 0,0,0 } ) }
PRIVATE _bckFore := { || If( g_existotal < 0, { 255,0,0 } , { 0,0,0 } ) }
FIELDS { "f_cve_art", "f_nomb_art", "Transform(g_existotal := ExistActual('01', Articulos->f_cve_art),'9999')" } ;
DYNAMICBACKCOLOR { bckColor, bckColor, bckColor } ;
DYNAMICFORECOLOR { bckFore , bckFore , _bckFore) } ;
Then if it works, But I think it is not the right way, what do you think?.
Please any tip to do it the right way.
Thanks.
Best Regards
Javier
Re: Forecolor in grid displays the records alternating color
Posted: Thu Apr 22, 2010 12:05 am
by Roberto Lopez
jparada wrote:Hi,
Why if I do something like this:
Code: Select all
DYNAMICFORECOLOR { bckFore , bckFore , If( g_existotal < 0, { 255,0,0 }, bckFore) } ;
This does not work.
Please, change it by:
Code: Select all
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255,0,0 } } , bckFore) } ;
It is difficult to assure that your program will work with only small chunks of code as analysis basis, but...
Please, in the future, when something do not work for you, please post a small complete sample showing the problem.
Re: Forecolor in grid displays the records alternating color
Posted: Thu Apr 22, 2010 1:21 am
by jparada
Hi,
Please, change it by:
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255,0,0 } } , bckFore) } ;
This works fine
It is difficult to assure that your program will work with only small chunks of code as analysis basis, but...
Please, in the future, when something do not work for you, please post a small complete sample showing the problem.
I am sorry for the inconvenience.
Thanks
Best Regards
Javier
Re: Forecolor in grid displays the records alternating color
Posted: Fri Apr 23, 2010 5:58 am
by jparada
Hi,
After getting that negative numbers are deployed with the color red (Thanks again Roberto).
Now I also like to do the same with DynamicBackColor property, and I try to do exactly as I do with the property DynamicForeColor, but I could not do it.
I attached image about the error that I am getting, please take a look, and also attach a small example, please take a look too.
Please can someone tell me how to fix it?
Thanks
Best Regards
Javier
Re: Forecolor in grid displays the records alternating color
Posted: Fri Apr 23, 2010 7:17 am
by Rathinagiri
Hi Javier,
Change the two lines (33,34) with this...
Code: Select all
DYNAMICBACKCOLOR { bckColor, bckColor, { || If( g_existotal < 0, { 255, 0, 0 }, If( RecNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) ) } } ;
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255, 255, 255 }, {0,0,0} ) } } ;
Re: Forecolor in grid displays the records alternating color
Posted: Fri Apr 23, 2010 2:46 pm
by jparada
Hi Rathinagiri,
Code: Select all
DYNAMICBACKCOLOR { bckColor, bckColor, { || If( g_existotal < 0, { 255, 0, 0 }, If( RecNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) ) } } ;
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255, 255, 255 }, {0,0,0} ) } } ;
It works ok, but.. can you tell me please why the way I suggested does not work and your example works well, what is the difference?, one way or the other.
Thanks
Best Regards
Javier