How to compare the values of the columns

Hi,

I would like to know how to compare the values of two different columns in my grid GC ,and how to create conditionnnal expression based on the result of this comparaison

Regards ,

Yacinus

3 Replies

VA Valli Syncfusion Team July 17, 2007 09:37 AM UTC

Hi Yacinus,

Attached is the sample link which uses Expression Fields and compare 2 column values.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-64151/main.htm

The above sample display the value either '0' or '1' in the column '"ConditionalExpressionColumn1".

The value '1' is displayed when the condition is true ie the [ProductID]>15 And [Quantity] < 45.

The value '0' is displayed when the condition is false.

Please let us know if this helps you.

Regards,
Valli


YY Yarius Yacinus July 19, 2007 09:22 AM UTC

Hello,

What if I want to change the background column according to the result of the comparaison .

Tnanks

Regards,
Yacinus


VA Valli Syncfusion Team July 20, 2007 04:41 AM UTC

Hi Yacinus,

Attached is the sample which helps you to change the background color and value of the cells which hold the comparison result of the Expression fields.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-64151-1/main.htm

'OnQueryCellStyleInfo' event is used to check the result of expression fields and change the column accordingly.

In the sample when the result of the expression field is false, the value '0' is checked and the celltext has been changed to 'False' and the background color to red.

If the result of the expression field is true, the value '1' is checked and the celltext has been changed to 'True' and the background color to green.

Please let us know if you have any other queries.

Regards,
Valli

Loader.
Up arrow icon