Sharepoint 2010 - Show/Hide columns with Conditional Formatting

In a previous post I describe how show/hide columns of a list with UI language, using javascript.

Now, I show how do the same using Conditional Formatting feature of Sharepoint Designer 2010.

I have same list with columns for language, DescriptionIT, DescriptionEN.


Open Sharepoint Designer 2010, and edit page with list view.

Select List and add Parameter for language taken from Cookies:


Then, select tag <TH> for List Column DescriptionIT, using selector at the bottom of page:


Now, in the Condition Formatting panel, click on Create and Apply Formatting:


In the filter clause, click on Advanced and write code as below:


Then, click OK, and Set Style, in Layout section, set Display:none:


Click OK and OK again.

Repeat steps selecting <TD> tag for values of column DescriptionIT.
Do it again for DescriptionEN column, with condition "($cookieLanguage!='1033')".

Save page and view in browser, checking columns changing UI Language.



Comments

Popular posts from this blog

Sharepoint 2010 - Enable/Disable Ribbon Button with EcmaScript

Sharepoint 2010 - Customizing Quick Launch with pages

SharePoint - Add button Apply to List Item Edit Form for Saving Item without closing form