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 DateTimeColumn 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:

      None

      Yesterday

      Today

      Tomorrow

      Last Week

      This Week        

      Next Week

      Last Month

      This Month

      Next Month

        

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 ChoiceColumn) 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:

      None

      Equals

      Does Not Equal

      Contains

      Does Not Contain

      Begins With

      Ends With

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.

        


ComponentOne Logo
Send comments about this topic to ComponentOne.
Copyright © GrapeCity, inc. All rights reserved.