<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hide Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/tag/hide/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/tag/hide/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Thu, 10 Jan 2019 12:46:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Auto Hide WebPart &#8211; How to</title>
		<link>https://blogit.create.pt/antoniobrisson/2015/01/08/auto-hide-webpart-how-to/</link>
					<comments>https://blogit.create.pt/antoniobrisson/2015/01/08/auto-hide-webpart-how-to/#respond</comments>
		
		<dc:creator><![CDATA[António Brisson]]></dc:creator>
		<pubDate>Thu, 08 Jan 2015 16:08:14 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Hide]]></category>
		<category><![CDATA[LimitedWebPartManager]]></category>
		<category><![CDATA[WebPart]]></category>
		<category><![CDATA[Webparts]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/antoniobrisson/?p=411</guid>

					<description><![CDATA[<p>Next time I want my webpart to hide itself I won&#8217;t use: this.hidden = true; because that will result in: System.InvalidOperationException: The Visible property cannot be set on Web Part XXXXXXX Instead, I will do the following: SPFile myPage= SPContext.Current.File; SPLimitedWebPartManager limitedWebPartManager; //Get the page's limited webpart manager using (limitedWebPartManager = myPage.GetLimitedWebPartManager(PersonalizationScope.Shared)) { System.Collections.Generic.List configuratorWebParts [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/antoniobrisson/2015/01/08/auto-hide-webpart-how-to/">Auto Hide WebPart &#8211; How to</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Next time I want my webpart to hide itself I won&#8217;t use:</p>
<pre>this.hidden = true;
</pre>
<p>because that will result in:</p>
<pre>
System.InvalidOperationException: The Visible property cannot be set on Web Part XXXXXXX
</pre>
<p>Instead, I will do the following:</p>
<pre>
SPFile myPage= SPContext.Current.File;
SPLimitedWebPartManager limitedWebPartManager;


   //Get the page's limited webpart manager
   using (limitedWebPartManager = myPage.GetLimitedWebPartManager(PersonalizationScope.Shared))
   {
      System.Collections.Generic.List configuratorWebParts = limitedWebPartManager.WebParts.Cast().Where(webpart =&gt; webpart.Title == "TITLE OF MY WEBPART").ToList();

     if (configuratorWebParts.Count &gt; 0)
     {
       foreach (System.Web.UI.WebControls.WebParts.WebPart webPart in configuratorWebParts)
       {
           webPart.Hidden = true;
           limitedWebPartManager.SaveChanges(webPart);
       }

      }
    }
</pre>
<p>and voila!</p>
<p>The post <a href="https://blogit.create.pt/antoniobrisson/2015/01/08/auto-hide-webpart-how-to/">Auto Hide WebPart &#8211; How to</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/antoniobrisson/2015/01/08/auto-hide-webpart-how-to/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
