<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SharePoint world of ECM and Information Management : Web Parts</title><link>http://msmvps.com/blogs/laflour/archive/tags/Web+Parts/default.aspx</link><description>Tags: Web Parts</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Connect to database directly without BDC</title><link>http://msmvps.com/blogs/laflour/archive/2009/04/22/connect-to-database-directly-without-bdc.aspx</link><pubDate>Tue, 21 Apr 2009 14:26:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1689516</guid><dc:creator>Michael</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/laflour/rsscomments.aspx?PostID=1689516</wfw:commentRss><comments>http://msmvps.com/blogs/laflour/archive/2009/04/22/connect-to-database-directly-without-bdc.aspx#comments</comments><description>&lt;p&gt;Lightning Tools released the Web Part, which allows you to connect to database directly, without using BDC. Having direct access to tables, stored procedures is that functionality with WSS and MOSS Standard didn’t have and a lot client suffered from that, developed their own solutions.&lt;/p&gt;  &lt;p&gt;Now &lt;strong&gt;&lt;a href="http://www.lightningtools.com/pages/lt%20data%20viewer%20web%20part.aspx"&gt;LT Data Viewer Web Part&lt;/a&gt;&lt;/strong&gt; provides you all necessary information&lt;/p&gt;  &lt;p&gt;The Lightning Tools Data Viewer Web Part can save you time and money as it stops the need for developers to write custom code and allows your end users to easily display and format the data they need to see. &lt;/p&gt;  &lt;p&gt;The LTDVWP provides the following benefits: &lt;/p&gt;  &lt;p&gt;1. No need for SharePoint Designer.&amp;#160; The LTDVWP is configured within the browser.   &lt;br /&gt;2. Allows for Integrated Security or provided Username and Password    &lt;br /&gt;3. Allows for connection to SQL, Oracle and Access (accdb &amp;amp; mdb) via the configuration of properties.&amp;#160; (No need for Connection Strings)    &lt;br /&gt;4. Connect directly to Tables/Views and Stored Procedures    &lt;br /&gt;5. Supports Aggregate Functions such as Count, Min, Max, and Sum    &lt;br /&gt;6. Allows for Conditional Formatting on Cells or Rows    &lt;br /&gt;7. Filtering of data    &lt;br /&gt;8. Caching of Data    &lt;br /&gt;9. Update, Delete, and Insertion of Data    &lt;br /&gt;10. Web Part Connections&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1689516" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://msmvps.com/blogs/laflour/archive/tags/Web+Parts/default.aspx">Web Parts</category><category domain="http://msmvps.com/blogs/laflour/archive/tags/BDC/default.aspx">BDC</category></item><item><title>SharePoint Tip #27. Do you know “How to make Web Part zone WCAG compliant”?</title><link>http://msmvps.com/blogs/laflour/archive/2009/03/20/sharepoint-tip-27-do-you-know-how-to-make-web-part-zone-wcag-compliant.aspx</link><pubDate>Fri, 20 Mar 2009 06:07:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1679815</guid><dc:creator>Michael</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/laflour/rsscomments.aspx?PostID=1679815</wfw:commentRss><comments>http://msmvps.com/blogs/laflour/archive/2009/03/20/sharepoint-tip-27-do-you-know-how-to-make-web-part-zone-wcag-compliant.aspx#comments</comments><description>&lt;p&gt;SharePoint provides you a nice ASP.NET model of Web Parts functionality. But when we are building the internet faced public sites and trying to apply &lt;a href="http://en.wikipedia.org/wiki/Web_Content_Accessibility_Guidelines"&gt;Web Content Accessibility Guidelines&lt;/a&gt; (WCAG) on Web Part Zones it come back and bite us. The major problem is that Web Part zone is not WCAG compliant. &lt;/p&gt;  &lt;p&gt;There are several ways to achieve desired behaviour&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;use “&lt;a href="https://aks.hisoftware.com/default.aspx"&gt;Accessibility Kit for SharePoint&lt;/a&gt;”. It seems to be very logical step to consider :) There are 25(!) different adapters, which have to address accessibility of Web Parts, but harsh reality is that none of them address Web Parts Zones compliance. Yep, it’s not a joke :) So, cross out this point&amp;#160; &lt;/li&gt;    &lt;li&gt;Use *custom* adapter on the top of WebPartZone to render content with &amp;lt;DIV&amp;gt; tag. Unfortunately SharePoint integrated a lot if JavaScripts to their web parts zones, that current approach breaks drag-n-drop functionality of Web Parts. (I reckon that’s why AKT didn’t address this issue) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In these days using custom adapters is the only way to achieve WCAG for Web Parts Zone. It won’t work for the intranet sites, due to broken drag-n-drop functionality, but for public sites it has not disadvantages, because you usually don’t allow users to change layout of public sites.&lt;/p&gt;  &lt;p&gt;You can find custom adapter for the Web Parts zone &lt;a href="http://blogs.msdn.com/eigilm/archive/2008/10/07/web-part-zone-adapter.aspx"&gt;there&lt;/a&gt;.&amp;#160; Thanks to eigilm for this code.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Have anything to add?! Send your tips to be published via &lt;/em&gt;&lt;a href="http://msmvps.com/blogs/laflour/contact.aspx"&gt;&lt;em&gt;this form&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1679815" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/laflour/archive/tags/Web+Parts/default.aspx">Web Parts</category><category domain="http://msmvps.com/blogs/laflour/archive/tags/SharePoint+Tips+and+Tricks/default.aspx">SharePoint Tips and Tricks</category><category domain="http://msmvps.com/blogs/laflour/archive/tags/Rendering/default.aspx">Rendering</category></item><item><title>Why Content Query Web Part (CQWP) doesn’t return all results.</title><link>http://msmvps.com/blogs/laflour/archive/2008/12/24/why-content-query-web-part-cqwp-doesn-t-return-all-results.aspx</link><pubDate>Wed, 24 Dec 2008 11:59:55 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1657655</guid><dc:creator>Michael</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/laflour/rsscomments.aspx?PostID=1657655</wfw:commentRss><comments>http://msmvps.com/blogs/laflour/archive/2008/12/24/why-content-query-web-part-cqwp-doesn-t-return-all-results.aspx#comments</comments><description>&lt;p&gt;I’ve seen &lt;a href="http://msmvps.com/blogs/laflour/archive/2008/05/29/subclassing-content-query-web-part-to-override-caml-query.aspx?CommentPosted=true#commentmessage" target="_blank"&gt;several cases&lt;/a&gt;, when people use CQWP and surprises when it doesn’t return all items in standard mode and returns all necessary items in “edit” mode. I find this topic is not being documented enough anywhere.&lt;/p&gt;  &lt;p&gt;So, CQWP ignores following items from your queried data:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Items are checked-out &lt;/li&gt;    &lt;li&gt;Items are not published and not-approved &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Those scenarios are “behaviour by design”, and I found such behaviour logical. User’s are working on their items, and work in progress – you shouldn’t show such items&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Workaround:&lt;/strong&gt; set “UseCache” property to “false”.&lt;/p&gt;  &lt;p&gt;Cite from &lt;a href="http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx" target="_blank"&gt;SharePoint team&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“&lt;em&gt;You are only seeing your items in edit mode because the caching infrastructure of the CQWP does not cache checked-out items of individual users and we disable cache in edit mode.&amp;#160; You can disable caching on your Web Part by setting the &amp;quot;UseCache&amp;quot; property to false&lt;/em&gt;”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So, my recommendation is to revise your approach to return published and checked-in stuff only.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1404.entry"&gt;Why Content Query Web Part (CQWP) doesn’t return all results.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1657655" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://msmvps.com/blogs/laflour/archive/tags/Web+Parts/default.aspx">Web Parts</category></item><item><title>Deploying SharePoint Web Parts as a part of PageLayouts in MOSS 2007</title><link>http://msmvps.com/blogs/laflour/archive/2008/08/09/deploying-sharepoint-web-parts-as-a-part-of-pagelayouts-in-moss-2007.aspx</link><pubDate>Fri, 08 Aug 2008 17:45:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644110</guid><dc:creator>Michael</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/laflour/rsscomments.aspx?PostID=1644110</wfw:commentRss><comments>http://msmvps.com/blogs/laflour/archive/2008/08/09/deploying-sharepoint-web-parts-as-a-part-of-pagelayouts-in-moss-2007.aspx#comments</comments><description>&lt;p&gt;Web Parts are an important and everywhere used part of SharePoint. Web Parts are documented pretty good and there are several sources describing as just ASP.NET WebParts (&lt;a href="http://www.amazon.com/ASP-NET-2-0-Web-Parts-Action/dp/193239477X/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1213500426&amp;amp;sr=8-1" target="_blank"&gt;Darren Neimke book&lt;/a&gt;) and some &lt;a href="http://msdn.microsoft.com/en-us/library/ms452873.aspx" target="_blank"&gt;resources about Web Parts in SharePoint&lt;/a&gt; as well. But in reality SharePoint WebPart specific stuff is not properly documented, and in this post I&amp;rsquo;d like to publish some tips regarding Web Parts in SharePoint&lt;/p&gt;
&lt;p&gt;&lt;b&gt;General Info &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Not all Web Parts are inherited from &lt;span style="font-family:Courier New;"&gt;System.Web.UI.WebControls.WebParts.&lt;b&gt;WebPart&lt;/b&gt; &lt;/span&gt;class. Some of them comes from &lt;span style="font-family:Courier New;"&gt;Microsoft.SharePoint.WebPartPages.&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:Courier New;"&gt;WebPart&lt;/span&gt;, &lt;/b&gt;which is inherited from the &lt;span style="font-family:Courier New;"&gt;System.Web.UI.WebControls.WebParts.&lt;b&gt;WebPart &lt;/b&gt;&lt;/span&gt;now. When you develop your own Web Parts, in mostly cases you need to inherit from &lt;span style="font-family:Courier New;"&gt;System.Web&lt;/span&gt; WebPart class&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Finding the connections&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;For some tasks you might handle the Web Part connection/disconnection programmatically. For example, connect your Web Part via code or via Page Layouts. To do this you need to know the Consumer and Provider names. It&amp;rsquo;s not the problem for your Web Parts, but how to find the Provider name for the out-of-the-box Web Parts?! For this you need to use Reflector. &lt;/p&gt;
&lt;p&gt;First, to know the class name of SharePoint Web Part you need just put any Web Part to the page and export it to XML. In that XML you will find the assembly and class name.&amp;nbsp; After that open that assembly in Reflector and navigates to the class you need to get Provider name. Scrutinize that Web Part class to find the connections and name of Provider connection. Connection may be not exactly in that class, but in one of the base classes.&lt;/p&gt;
&lt;p&gt;For example for Page Filter Web Parts the Provider name is &amp;ldquo;&lt;span style="font-family:Courier New;"&gt;ITransformableFilterValues&lt;/span&gt;&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Deploying Web Parts with connections&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;If you deploy you pages and want to have Web Parts being already connected for each new page user creates, then you need to connect Web Part via XML description inside Page Layout.&lt;/p&gt;
&lt;p&gt;Connection consists from 3 parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Consumer ID and Name &amp;ndash;which you know, because usually it&amp;rsquo;s you own custom Web Parts &lt;/li&gt;
&lt;li&gt;Provider ID and Name &amp;ndash; I described above how to extract that name &lt;/li&gt;
&lt;li&gt;Name of the parameter you select from dialog box when connect Web Parts manually. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, let&amp;rsquo;s start:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Put any Web Parts to your Page Layout (I use SharePoint Designer for this, because it simplify my work), save page and navigate to the code. &lt;/li&gt;
&lt;li&gt;In code find the &amp;lt;WebPartPages:WebPartZone&amp;gt; section, and there you will find you Web Parts markup tagged with &amp;lt;Components: prefix. &lt;/li&gt;
&lt;li&gt;Find the ProviderID attribute of the Web Parts you want to connect and remember values . These values will be used when we create the connection between Web Parts. &lt;/li&gt;
&lt;li&gt;Open your page in browser to verify it works. &lt;/li&gt;
&lt;li&gt;Connect Web Parts manually, and save the name of the parameter which is shown in the popup dialog box when you connect Web Parts &lt;/li&gt;
&lt;li&gt;Remove connections between Web Parts, and return back to SharePoint designer &lt;/li&gt;
&lt;li&gt;Open the Page Layout code and navigate to the very beginning of document. Try to find the following section &amp;ldquo;&amp;lt;WebPartPages:SPProxyWebPartManager&amp;rdquo;. If you don&amp;rsquo;t have this section you can miss the following step &lt;/li&gt;
&lt;li&gt;Add the &amp;lt;WebPartPages:SPProxyWebPartManager runat=&amp;quot;server&amp;quot; ID=&amp;quot;ProxyWebPartManager&amp;quot;&amp;gt;&amp;nbsp; section inside &amp;ldquo;PlaceHolderMain&amp;rdquo; content holder &lt;/li&gt;
&lt;li&gt;Now, we are ready to create connections. Add the following codesnippet inside SPProxyWebPartManager &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;SPWebPartConnections&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:SPWebPartConnection&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;g_myConnectionName&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;                &lt;span style="color:#ff0000;"&gt;ConsumerConnectionPointID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;IFilterValues&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ConsumerID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;WebPartA&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;                &lt;span style="color:#ff0000;"&gt;ProviderConnectionPointID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ITransformableFilterValues&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ProviderID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;WebPartB&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:TransformableFilterValuesToFilterValuesTransformer&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;MappedConsumerParameterName&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Parameter&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:TransformableFilterValuesToFilterValuesTransformer&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:SPWebPartConnection&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;SPWebPartConnections&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let&amp;rsquo;s review the &amp;ldquo;blue&amp;rdquo; selections, because it&amp;rsquo;s where connection magic happens&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;
&lt;ul&gt;
&lt;li&gt;g_myConnectionName is the name of current connection, can be any name &lt;/li&gt;
&lt;li&gt;IFilterValues &amp;ndash; Consumer interface name of Web Part which accept connection &lt;/li&gt;
&lt;li&gt;WebPartA &amp;ndash; consumer Web Part ID from the WebPartZone section we found and remembered previously &lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;ITransformableFilterValues&lt;/span&gt; &amp;ndash; Provider interface name of Web Part which provides connection (in this sample I used Page Filter web parts and they have such provider name. Refer to the &amp;ldquo;&lt;b&gt;Finding the connections&lt;/b&gt;&amp;rdquo; section where I described how to extract the names &lt;/li&gt;
&lt;li&gt;WebPartB &amp;ndash; provider Web Part ID from the WebPartZone section we found and remembered previously &lt;/li&gt;
&lt;li&gt;Parameter &amp;ndash; the name from the connection dialog box where you select the parameter &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;10.&amp;nbsp; Save the page layout. Go to SharePoint and create the new page based on that page layout. After page will be created you can find that your Web Parts are already connected. Job done!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Take into account, that you can&amp;rsquo;t change Web Parts connection for pages created for the Page Layouts with predefined Web Part connections.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211158.entry"&gt;Deploying SharePoint Web Parts as a part of PageLayouts in MOSS 2007&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644110" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://msmvps.com/blogs/laflour/archive/tags/Web+Parts/default.aspx">Web Parts</category></item><item><title>Subclassing Content Query Web Part to override CAML query</title><link>http://msmvps.com/blogs/laflour/archive/2008/05/29/subclassing-content-query-web-part-to-override-caml-query.aspx</link><pubDate>Wed, 28 May 2008 13:37:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1628334</guid><dc:creator>Michael</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/laflour/rsscomments.aspx?PostID=1628334</wfw:commentRss><comments>http://msmvps.com/blogs/laflour/archive/2008/05/29/subclassing-content-query-web-part-to-override-caml-query.aspx#comments</comments><description>&lt;p&gt;The Content Query Web Part (CQWP) in MOSS is one of the popular out-of-the-box Publishing components which is used in content management sites, allowing you to get results from different sources.&lt;/p&gt; &lt;p&gt;But sometimes out of the box functionality is not enough to meet your requirements, and you need to customize CQWP. There are several resources describing how to do this - &lt;a href="http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx" target="_blank"&gt;1&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/aa981241.aspx" target="_blank"&gt;2&lt;/a&gt;, &lt;a href="http://www.codeplex.com/ECQWP" target="_blank"&gt;3&lt;/a&gt;, &lt;a href="http://www.codeplex.com/sptoolbox/Release/ProjectReleases.aspx?ReleaseId=11150" target="_blank"&gt;4&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The most important features which are missed in CQWP are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;overriding query to use custom CAML  &lt;li&gt;enabling web-part connections&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;To implement these functionality you need to subclass ContentByQueryWebPart class and override several methods.&lt;/p&gt; &lt;p&gt;Below I will describe what exactly need to be done to achieve desired behaviour.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Query Override&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;To have custom CAML query in your Web part you need to override CreateChildControls base method. You can find samples how to do this in the references above, but it&amp;#39;s done so implicitly, that you can easily spend hours to find out why you code doesn&amp;#39;t work and gives you different errors&lt;/p&gt; &lt;p&gt;The crucial part is in the way sending the query to the base class within overrided CreateChildControls &lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt; &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; CreateChildControls()&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.QueryOverride = customQueryString;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.CreateChildControls();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     QueryOverride = &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     CommonViewFields = &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;First, you need to set your custom query to the &amp;quot;this.QueryOverride&amp;quot; to inform base class about query - line 3&lt;/p&gt;
&lt;p&gt;Second, call base CreateChildControls() allowing your query being executed - line 5&lt;/p&gt;
&lt;p&gt;Third and last - &lt;strong&gt;CLEAN&lt;/strong&gt; query and view fields properties - line 7,9. Without this step you will get errors when open your Web Part in edit mode&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Enabling Connection&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Content Query WP doesn&amp;#39;t accept any connections by default. You need to implement this too. Everything you need to to is just add ConnectionConsumer attribute. But trick in setting the right attribute which is used in Parameter dialog box, when you connect two web-parts.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; [ConnectionConsumer(&lt;span style="color:#006080;"&gt;&amp;quot;Another WebPart&amp;quot;&lt;/span&gt;, &lt;span style="color:#006080;"&gt;&amp;quot;IFilterValues&amp;quot;&lt;/span&gt;, AllowsMultipleConnections = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SetConnectionInterface(IFilterValues filterProvider)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (filterProvider != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// save provider with values&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;         providerValues = filterProvider.ParameterValues;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         _filterProviders.Add(filterProvider);&amp;nbsp; &lt;span style="color:#008000;"&gt;// variable declaration is List&amp;lt;IFilterValues&amp;gt; _filterProviders = new List&amp;lt;IFilterValues&amp;gt;();&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         List&amp;lt;ConsumerParameter&amp;gt; parameters = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; List&amp;lt;ConsumerParameter&amp;gt;();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// add params&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;         parameters.Add(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ConsumerParameter(&lt;span style="color:#006080;"&gt;&amp;quot;param1&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsSingleValue |&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsEmptyValue));&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;         parameters.Add(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ConsumerParameter(&lt;span style="color:#006080;"&gt;&amp;quot;param2&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsMultipleValues |&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsAllValue |&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsEmptyValue));&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;         filterProvider.SetConsumerParameters(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ReadOnlyCollection&amp;lt;ConsumerParameter&amp;gt;(parameters));&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  22:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Method name can be any, but pay attention which provider you are using . WebPart providers send data via different provider interfaces, for example when you are working with Filtering web parts (like &amp;quot;Current User Filter&amp;quot; web part) then you need to &amp;quot;listen&amp;quot; your incoming connections via IFilterValues (thx Mutaz for this findings), for other WB it could be IWebPartField or IWebPartRow. &lt;/p&gt;
&lt;p&gt;If you are expecting to get data from WP via unsupported provider you connection link will be dimmed&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Practical Sample&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;@d2design kindly asked to provide practical sample, for example how to use current user as a keyword :)&lt;/p&gt;
&lt;p&gt;Actually, it&amp;#39;s good example which shows how use both features I described. &lt;/p&gt;
&lt;p&gt;To do this you need to have:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;ShareServices (SSP) with UserProfile, where current userName is stored 
&lt;li&gt;&amp;quot;Current User Filter&amp;quot; WebPart, to get the userName from SSP. It returns you logged user name by default (not necessary actually, as well as SSP, because you could resolve you user name via standard asp.net User class when construct custom query) 
&lt;li&gt;Enable WebPart connections as I described above. You need to use IFilterValue interface for &amp;quot;Current User Filter&amp;quot; and store your incoming user name in variable. 
&lt;li&gt;Override query to include your userName in resulted custom query.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;TIPS:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When you are quering content which is not published and approved (like pages) you wont be able to see that content on the page in final view. You data will be available in page edit mode only, because they are treated as &amp;quot;draft&amp;quot; data.&lt;/li&gt;
&lt;li&gt;&amp;lt;OrderBy&amp;gt;CAML tag is not parsed by CQWP, you need to remove it from your query and set the related order field of CQWP class&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1069.entry"&gt;Subclassing Content Query Web Part to override CAML query&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1628334" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://msmvps.com/blogs/laflour/archive/tags/Web+Parts/default.aspx">Web Parts</category></item></channel></rss>