We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to compare the values of the columns

Thread ID:

Created:

Updated:

Platform:

Replies:

64151 Jul 16,2007 06:17 AM Jul 20,2007 12:41 AM ASP.NET Web Forms (Classic) 3
loading
Tags: Grouping
Yarius Yacinus
Asked On July 16, 2007 06:17 AM

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

Valli [Syncfusion]
Replied On July 17, 2007 05:37 AM

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

Yarius Yacinus
Replied On July 19, 2007 05:22 AM

Hello,

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

Tnanks

Regards,
Yacinus

Valli [Syncfusion]
Replied On July 20, 2007 12:41 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;