The conditional formatting option in Alpha Anywhere lets you format data conditionally, depending on its value. For example, you might set the color of the quantity field to be red if it is above average.
In the video, you'll see the conditional formatting in action, including conditional formatting at the cell and control level, and conditional formatting at the row level.
To see how to add conditional images to a grid, check out this video.
Where this property allows you to alter the styles of a field, you can also alter the style of a given row using the Conditional Style properties in the Shading and Dividers section of the Grid Properties page.
Open the Grid Builder and go to the Design tab. On the Component Type page select read-only
On the Data Source page select either .dbf or SQL . This example uses the SQL table Northwind database.
On Query(DBF) or Query(AlphaDAO) create the connection to your database and select a table to work with. This example uses the Order_details table.
On the Fields page add some fields from the Available Fields: list to the Selected: fields list.
Select a selected field, in this case Quantity, and scroll down the field's property list to the Summary values section.
Check the Average checkbox under the Summary values section.
Still in Field Properties , go to the Display Settings and click the Conditional style property button.
The Conditional Style (Server-side) dialog will open. Click the Add condition button at the bottom of the dialog.
The Edit Condition dialog will load. Click the ' Insert Fieldname ' hyperlink.
Add the 'Quantity' field, or the fields you are using, to your expression. Then after it add '> summary.quantity.average' to complete the Expression.
Quantity > summary.quantity.average
In the Style: menu click on the Font color selector button and change the font color. Click OK to add the Expression to the Conditional Style dialog.
Click the Add condition button again. Add a second condition, this time using a less than < sign.
Quantity < summary.quantity.average
Set a different Font color for this condition. Click OK, the Conditional Style (Server-side) dialog should now look something like this:
Now go to Live Preview > Full Preview . All of the records in the Quantity field should be colored differently, depending on if they are above or below the average.
The conditional formatting option allows you to format data conditionally, depending on the value in the field. For example, you might set the color of the quantity field to be red if it is above average. In this video, we demonstrate conditional formatting at the cell and control level and conditional formatting at the row level.
The conditional image feature allows you to display different icons in the Grid component based on the data in each row. This video demonstrates how above average quantities have a green icon and below average have a red icon. There is no limit to the number of conditional tests.