Welcome to LightSwitch Desktop Edition > FlexGrid for LightSwitch Overview > Customizing the C1FlexGrid Appearance > Adding Conditional Formatting |
The C1FlexGrid control includes properties that conditionalize the foreground and background colors of specific values (numbers, dates, times, etc.) This will make specific values, and/or dates and times, stand out on your grid.
To set these properties, select FlexGrid Numeric Column or FlexGrid DateTime Column from the drop-down next to the appropriate field and view the Advanced group
Other kinds of conditional formatting (specific ranges, multiple colors) can be achieved in code. See Programming FlexGrid for LightSwitch.
Specifying Conditional Formatting for Numeric Values
You can customize how specific numeric values are emphasized using the Advanced group of the FlexGrid Numeric Column element. Foreground and background colors for specific values can be set, and/or the text may be bolded.
Enter a value in the High Value field and choose the color(s) you wish, and bold text if desired. Cells that are greater than this value are formatted with the specified color/bold attributes.
Enter a Low Value and make your selection. Cells that are less than this value are formatted with the specified color/bold attributes.
Specifying Conditional Formatting for Date and Time Values
You can customize how specific date and time values are emphasized using the Advanced group of the FlexGrid TimeDate Column element. Foreground and background colors for specific values can be set, and/or the text may be bolded.
Choose an option in the Format Dates field and choose the color(s) you wish, and bold text if desired. Cells that meet these criteria are formatted with the specified color/bold attributes.
Following are the available options for the Format Dates property:
Specifying Conditional Formatting for Text and Choice Columns
You can customize how specific values are emphasized using the Advanced group of the FlexGrid Text Column element (and also FlexGrid Choice Column) element. Foreground and background colors for specific values can be set, and/or the text may be bolded.
Following are the available options for the Format Condition property:
The Value property is used in conjunction with the Format Condition property to specify the condition. Cells that satisfy the condition are formatted with the specified color/bold attributes.