Friday, December 12, 2014

Conditional Formatting in Sharepoint 2010


Problem Statement:  
  In a task list, we need to change background color of critical column based on its value and also the status (another field value)

Approach we Used: 
We have Conditional Formatting option in the designer using which we can set styles and also display the content based on conditions

Explanation with Example:
Step1: Open site in the designer and open one view.aspx file of a list that you need formatting

Step 2: In the View tab of designer, we have Task Panes, in that select conditional Formatting.


Step 3: Now select one cell content in the column on which we need formatting.
                Eg: On top, in critical section I selected yes word.

Step 4: Then Conditional Formatting section is highlighted, and then click on Create dropdown button which is in Conditional Formatting section



Step 5: You can see 3 options available, Show content, Hide Content, Apply Formatting, choose any one.
                Eg: I have chosen Apply Formatting




Step 6: Then we get conditional Criteria window, in which we set condition.
                Here you can group conditions, and as you can see, select field name in the list and we can compare to some value for equal or other etc. We even have advanced to have complex conditions

Step 7: Now after you complete preparing condition, click on set style which means, this style which we put is applied on the column items which we selected in the starting if the given condition is satisfied

Step 8: Now style window is opened in which we can set our style we need. Finally click on Ok, to finish our work.

We can see the condition created in the Conditional Formatting section which you can select it and modify further.

Similarly we can hide or show content based on conditions.


Done.

Wish it helps you

No comments:

Post a Comment