<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://consultingblogs.emc.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Jomit's Blog</title><subtitle type="html">Technical Enthusiast</subtitle><id>http://consultingblogs.emc.com/jomitvaghela/atom.aspx</id><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/default.aspx" /><link rel="self" type="application/atom+xml" href="http://consultingblogs.emc.com/jomitvaghela/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.20423.1">Community Server</generator><updated>2007-02-13T12:58:00Z</updated><entry><title>Whoa! Google Chrome has crashed. Restart Now ?</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2008/09/03/whoa-google-chrome-has-crashed-restart-now.aspx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2008/09/03/whoa-google-chrome-has-crashed-restart-now.aspx</id><published>2008-09-03T14:08:00Z</published><updated>2008-09-03T14:08:00Z</updated><content type="html">This was the first message I got after installing google’s new browser Google Chrome . . . But since then its working like a charm. . . . . Here are some of the features I like the most : Thumnail view of the ‘ Most Visited ’ sites when you first open the browser Opening ‘ incognito window’ for private browing (seems similar to IE-8 privacy feature ) ‘Inspect Element’ to see the HTML source code of that element along with the DOM John and Rory have also posted some interesting performance benchmarks...(&lt;a href="http://consultingblogs.emc.com/jomitvaghela/archive/2008/09/03/whoa-google-chrome-has-crashed-restart-now.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=12431" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="Google Chrome" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Google+Chrome/default.aspx" /></entry><entry><title>A-Z Guide to being an Architect</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2008/06/05/a-z-guide-to-being-an-architect.aspx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2008/06/05/a-z-guide-to-being-an-architect.aspx</id><published>2008-06-05T06:00:00Z</published><updated>2008-06-05T06:00:00Z</updated><content type="html">&lt;P&gt;While reading the &lt;A href="https://www.microsoft.com/downloads/details.aspx?familyid=dd466bbb-1b7d-438e-9f9a-954ce2058f15&amp;amp;displaylang=en" target=_blank&gt;Architecture Journal&lt;/A&gt; I came across this excellent thought of &lt;A href="http://msdn.microsoft.com/en-us/library/cc505969.aspx" target=_blank&gt;skills from A-Z&lt;/A&gt; which really depicts that &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;"architecture is as much about softer skills—good judgment, balance, and other wisdom—as it is about understanding the broad technical landscape, or the skills required to design and implement an architecture" &lt;BR&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have compiled this table to stick it on my desk This would always remind me 'where I need to improve myself'... &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/AZGuidetobeinganArchitect_982C/architect_1.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height=561 alt=architect src="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/AZGuidetobeinganArchitect_982C/architect_thumb_1.png" width=725 border=0&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=11328" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author></entry><entry><title>Live Mesh - gone public now</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2008/04/23/live-mesh-gone-public-now.aspx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2008/04/23/live-mesh-gone-public-now.aspx</id><published>2008-04-23T09:18:10Z</published><updated>2008-04-23T09:18:10Z</updated><content type="html">&lt;p&gt;   &lt;br /&gt;&lt;a href="https://www.mesh.com/Welcome/Welcome.aspx"&gt;&lt;font face="Calibri" size="3"&gt;&lt;em&gt;Live mesh&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;em&gt;&amp;#160;&lt;/em&gt;&lt;font face="Calibri" size="3"&gt;&lt;em&gt;is a new technology and platform that enables synchronization and storage &amp;quot;to the cloud.&amp;quot;&amp;#160; A Software + Services platform and ecosystem that enables unique new customer value with the core philosophy to make it easy to manage information in a world where people have multiple computing experiences (i.e. PCs and applications, web sites, phones, video games, music and video devices) that they use in the context of different communities (i.e. myself, family, work, organizations).&lt;/em&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri" size="3"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font face="Calibri" size="3"&gt;More details on history and future of this technology on&amp;#160; Channel9 Interview - &lt;/font&gt;&lt;a href="http://channel9.msdn.com/showpost.aspx?postid=399578"&gt;&lt;font face="Calibri" size="3"&gt;Ray Ozzie: Introducing Live Mesh&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri" size="3"&gt;&lt;em&gt;(After signing in it says that the &amp;quot;tech preview program is currently full&amp;quot;. So we have to fill up a registration form to get informed whenever the space is available)&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=10768" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="Live Services" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Live+Services/default.aspx" /><category term="Software + Services" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Software+_2B00_+Services/default.aspx" /><category term="Live Mesh" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Live+Mesh/default.aspx" /></entry><entry><title>Configuring Windows Live Writer</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2008/04/22/configuring-windows-live-writer.aspx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2008/04/22/configuring-windows-live-writer.aspx</id><published>2008-04-22T08:04:16Z</published><updated>2008-04-22T08:04:16Z</updated><content type="html">&lt;p&gt;&lt;font face="Calibri" size="3"&gt;     &lt;br /&gt;I just started using &lt;/font&gt;&lt;a href="http://get.live.com/writer/overview"&gt;&lt;font face="Calibri" size="3"&gt;'Windows Live Writer'&lt;/font&gt;&lt;/a&gt;&lt;font face="Calibri" size="3"&gt;&amp;#160; (in fact I am using it right now for this post) and thought it would be good to share, how to configure it for our conchango blogs.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri" size="3"&gt;Open Windows Live Writer      &lt;br /&gt;Goto -&amp;gt; Weblog -&amp;gt; Add Weblog Account&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-1.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="404" alt="step-1" src="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-1_thumb.jpg" width="466" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="403" alt="step-2" src="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-2_thumb.jpg" width="467" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-3.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="408" alt="step-3" src="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-3_thumb.jpg" width="466" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-finish.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="407" alt="step-finish" src="http://blogs.conchango.com/blogs/jomitvaghela/WindowsLiveWriter/ConfiguringWindowsLiveWriter_9643/step-finish_thumb.jpg" width="466" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;    &lt;br /&gt;&lt;font face="Calibri" size="3"&gt;One thing which I found very quick and easy via live writer is uploading and managing images for posts.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=10751" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="Windows Live Writer" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Windows+Live+Writer/default.aspx" /><category term="Blogging" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Blogging/default.aspx" /><category term="Live Services" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Live+Services/default.aspx" /></entry><entry><title>Windows Sharepoint Services (WSS) - Groups, Roles &amp; User management API’s</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2008/03/31/windows-sharepoint-services-wss-groups-roles-amp-user-management-api-s.aspx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2008/03/31/windows-sharepoint-services-wss-groups-roles-amp-user-management-api-s.aspx</id><published>2008-03-31T05:41:00Z</published><updated>2008-03-31T05:41:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Last week I worked on a pretty basic Sharepoint requirement but while developing the solution I came across few interesting things which I am going to share here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Requirement:&lt;BR&gt;The overall requirement was to provide a document sharing web application which can be accessed by different types of users with different permissions on different documents. Also all these users would be stored in SQL Server database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Solution:&lt;BR&gt;My solution to this was to create a set of Groups and Document Libraries in Sharepoint. Assign Groups to Document Libraries with Specific permissions and then add Users to these Groups via a Custom Membership Provider. &lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/SPAN&gt;Here is how I am implementing it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Initial MOSS Configuration:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;tab-stops:list 36.0pt;mso-list:l0 level1 lfo1;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Create a web application and a default site collection&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;tab-stops:list 36.0pt;mso-list:l0 level1 lfo1;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Create &amp;amp; Register a &lt;/FONT&gt;&lt;A class="" href="http://www.kcdholdings.com/blog/?p=113" target=_blank&gt;&lt;FONT size=3&gt;Custom Membership Provider&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;tab-stops:list 36.0pt;mso-list:l0 level1 lfo1;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Enable the &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb975135.aspx#MOSSFBAPart2_DevelopingCustom" target=_blank&gt;Forms Based Authentication&lt;/A&gt; on the site.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;tab-stops:list 36.0pt;mso-list:l0 level1 lfo1;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Configure the Custom Membership Provider&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;tab-stops:list 36.0pt;mso-list:l0 level1 lfo1;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Create Document Lib&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;raries&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;The next steps were to write the following pieces of interesting code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;[Create Site Groups]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/P&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;IMG title="Create Sharepoint Groups" style="WIDTH:627px;HEIGHT:234px;" height=234 alt="Create Sharepoint Groups" src="http://blogs.conchango.com/photos/conchango_bloggers/images/10448/original.aspx" width=627&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE:12pt;FONT-FAMILY:Calibri;mso-fareast-font-family:'Times New Roman';mso-bidi-font-family:'Times New Roman';mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;BR style="PAGE-BREAK-BEFORE:always;"&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;[Assign Site Level Roles to Groups]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;IMG title="Assing Roles to Group" style="WIDTH:665px;HEIGHT:347px;" height=347 alt="Assing Roles to Group" src="http://blogs.conchango.com/photos/conchango_bloggers/images/10449/original.aspx" width=665&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;[Add Groups to Document Libraries with Roles]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;IMG title="Add Groups to Document Library" style="WIDTH:904px;HEIGHT:348px;" height=348 alt="Add Groups to Document Library" src="http://blogs.conchango.com/photos/conchango_bloggers/images/10450/original.aspx" width=904&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;The important thing to note here is the “BreakRoleInheritance” method which I had to add to remove this error:&lt;BR&gt;“&lt;I style="mso-bidi-font-style:normal;"&gt;This operation is not allowed on a object that inherits permissions.”&lt;/I&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:12pt;FONT-FAMILY:Calibri;mso-fareast-font-family:'Times New Roman';mso-bidi-font-family:'Times New Roman';mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;BR style="PAGE-BREAK-BEFORE:always;"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;[Add Users to Groups]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;IMG title="Add Users to Groups" style="WIDTH:918px;HEIGHT:270px;" height=270 alt="Add Users to Groups" src="http://blogs.conchango.com/photos/conchango_bloggers/images/10451/original.aspx" width=918&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;The field “loginName” here accepts a semicolon delimited string where the first value is the ‘CustomMembershipProvider’ name assigned in the web.config file.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;Apart from few initial configuration issues in the FBA the code is now working all ok in the Proof Of Concept project. I am going to integrate the same in my LIVE Project and would post any more useful stuff.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0cm 0cm 0pt;"&gt;&lt;SPAN style="FONT-FAMILY:Calibri;"&gt;&lt;FONT size=3&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=10447" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="MOSS" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/MOSS/default.aspx" /><category term="WSS3.0" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/WSS3.0/default.aspx" /><category term="Sharepoint" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Sharepoint/default.aspx" /><category term="User Management API's" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/User+Management+API_2700_s/default.aspx" /><category term="Site Groups" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Site+Groups/default.aspx" /></entry><entry><title>WebParts and Dynamic UserControls in MOSS</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2007/07/19/WebParts-and-UserControls-in-MOSS.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="9029" href="http://consultingblogs.emc.com/jomitvaghela/attachment/7721.ashx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2007/07/19/WebParts-and-UserControls-in-MOSS.aspx</id><published>2007-07-19T22:29:00Z</published><updated>2007-07-19T22:29:00Z</updated><content type="html">&lt;font face="Times New Roman" size="3"&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;br /&gt;I have recently started working on my first MOSS project and came up with a very common scenario of wanting to use UserControls into WebParts simply because of the great Designer support for UserControls in Visual Studio. (&lt;a href="http://msdn.microsoft.com/msdnmag/issues/05/09/WebParts/default.aspx?loc=&amp;amp;fig=true#fig14" target="_blank"&gt;Usercontrols vs WebParts&lt;/a&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;br /&gt;Also I wanted my WebParts to just act like a shell and provide me the build in features of serializing, storing, and retrieving the site customization and member personalization data without being worried about rendering of the actual UI controls.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;br /&gt;So, I created a WebPart which can host any Usercontrol dynamically and also expose the configured properties of the usercontrol onto a custom editor. It sounds like re-creating your own SmartPart but I thought to give it a try to understand how things work. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;br /&gt;&lt;br /&gt;Ok, here is an overview of some of the important bits that I did :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span&gt;-&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;Created a property on the WebPart for storing the path of the Usercontrol and loaded the usercontrol dynamically using&lt;/span&gt; &lt;span style="font-size:10pt;font-family:'Courier New';"&gt;Page.LoadControl&lt;/span&gt; &lt;span style="font-size:10pt;font-family:Tahoma;"&gt;function in the &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;CreateChildControls &lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;method of the WebPart.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span&gt;-&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;Created a custom editor part by inheriting &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;EditorPart&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt; and in the &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;CreateChildControls&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt; method extracted all the editable properties of the UserControl currenly loaded on the WebPart using &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;TypeDescriptor&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;.GetProperties()&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;method.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span&gt;&lt;span style="font:7pt 'Times New Roman';"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span&gt;-&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;Then I added a &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;TextBox&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt; control for each of these properties on the custom editor. ( We can further add a smart selection of controls based on the types of the properties eg: Checkbox for Boolean property, DropDownList for List and RadioButtons for Enums)&lt;br /&gt;Now the most important thing was to make sure that the values typed in from the custom editor part should be passed on to the actual UserControl hosted in the WebPart. &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span&gt;-&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;So I created an &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;ArrayList&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt; of controls added for properties, on the custom editor part and a &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;Hashtable&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt; of propertynames, on the WebPart. On the &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;ApplyChanges()&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;method of the custom editor part I looped through all controls &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;ArrayList&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt; and assigned the value of the control to the &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;Hashtable&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt; in the WebPart with the key as the property name.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;tab-stops:list 36.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span&gt;-&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;Then it was just a matter of looping through the &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;Hashtable &lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;and setting the values back to the UserControl in the &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;CreateChildControls &lt;/span&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;method of the WebPart.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;br /&gt;&lt;br /&gt;I have attached the code below along with a sample ASCX file to use. I kept the ascx file in the IIS webapplication folder under a sub folder named &amp;ldquo;UserControls&amp;rdquo;.&lt;br /&gt;eg: &lt;span style="font-weight:normal;font-family:Tahoma;"&gt;C:\Inetpub\wwwroot\wss\VirtualDirectories\[WebAppDirector]\UserControls&lt;br /&gt;&lt;br /&gt;&lt;img height="727" src="http://blogs.conchango.com/photos/conchango_bloggers/images/7717/original.aspx" style="width:1152px;height:727px;" width="1152" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;img height="726" src="http://blogs.conchango.com/photos/conchango_bloggers/images/7718/original.aspx" style="width:1152px;height:726px;" width="1152" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;img height="724" src="http://blogs.conchango.com/photos/conchango_bloggers/images/7719/original.aspx" style="width:1152px;height:724px;" width="1152" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 18pt;"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&lt;span style="font-weight:normal;font-family:Tahoma;"&gt;&lt;img height="721" src="http://blogs.conchango.com/photos/conchango_bloggers/images/7720/original.aspx" style="width:1152px;height:721px;" width="1152" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/font&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=7721" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="MOSS" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/MOSS/default.aspx" /><category term="UserControls" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/UserControls/default.aspx" /><category term="WebParts" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/WebParts/default.aspx" /><category term="WSS3.0" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/WSS3.0/default.aspx" /></entry><entry><title>Alphabetical Grouping with Nested Datalist</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2007/03/26/Alphabetical-Grouping-with-Nested-Datalist.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="1955" href="http://consultingblogs.emc.com/jomitvaghela/attachment/6462.ashx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2007/03/26/Alphabetical-Grouping-with-Nested-Datalist.aspx</id><published>2007-03-26T17:07:00Z</published><updated>2007-03-26T17:07:00Z</updated><content type="html">&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Recently working on an ecommerce project I came across a good functionality for asp.net wherein the data needs to be grouped by the alphabets across multiple columns as below:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;img height="238" src="http://blogs.conchango.com/photos/conchango_bloggers/images/6460/original.aspx" style="width:376px;height:238px;" width="376" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;I tried searching the net but couldn&amp;rsquo;t find anything very similar, apart from a grouped repeater control but that needed some fixing so I thought to build it from scratch and share it. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Description&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;The used datatables and nested datalist controls to created the above functionality. The outer datalist control is binded with a datatable containing unique first letters from the data. While the inner datalist is binded, in the ItemDataBound event of the outer datalist, with the data starting from the letter in the outer datatable. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;img height="183" src="http://blogs.conchango.com/photos/conchango_bloggers/images/6461/425x183.aspx" width="425" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;I have attached a sample code of what I have build. The code needs some minor configurations for the fieldnames. I have also added a function to Sort the datatable which may not be required if we are already fetching sorted data from database.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;There may be other ways to do it but this is what came to my mind first and I implemented it instantly &lt;/span&gt;&lt;span style="font-size:10pt;font-family:Wingdings;"&gt;&lt;span&gt;J&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;All inputs are welcomed,&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;-Jomit&lt;/span&gt;&lt;/p&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=6462" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="ASP.net" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/ASP.net/default.aspx" /><category term="Grouping" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Grouping/default.aspx" /><category term="Alphabetical Sorting" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Alphabetical+Sorting/default.aspx" /><category term="DataList" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/DataList/default.aspx" /></entry><entry><title>Editable Custom Visualizer</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2007/03/06/Editable-Custom-Visualizer.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="38573" href="http://consultingblogs.emc.com/jomitvaghela/attachment/6206.ashx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2007/03/06/Editable-Custom-Visualizer.aspx</id><published>2007-03-06T14:13:00Z</published><updated>2007-03-06T14:13:00Z</updated><content type="html">&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;We all know that &lt;a href="http://msdn2.microsoft.com/en-us/library/zayyhzts.aspx"&gt;Visualizers&lt;/a&gt; are a great feature of Visual Studio 2005 debugger UI. It gives us a really nice meaningful way to look at the data.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;img alt="Visualizer Sample" height="210" src="http://blogs.conchango.com/photos/conchango_bloggers/images/6207/425x210.aspx" style="width:425px;height:210px;" title="Visualizer Sample" width="425" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Visual Studio also enables us to create Custom Visualizers using &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;DialogDebuggerVisualizer &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;class. A long time back &lt;a href="http://blogs.conchango.com/howardvanrooijen/archive/2005/11/24/Conchango-Xml-Visualizer-for-Visual-Studio-2005-_2800_RTM_2900_.aspx"&gt;Howard&amp;nbsp;van Rooijen&lt;/a&gt;&amp;nbsp;had created a great tool using visualizers. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;br /&gt;There are 4 in-build visualizers available with VS 2005 among which only the dataset visualizer is editable and rest all are read-only visualizers. This gave a thought to&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;em&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;em&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;how can I make a custom visualizer editable&lt;/span&gt;&lt;/em&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt; ? &lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;br /&gt;The answer is : Simply using the &lt;span style="font-size:10pt;font-family:'Courier New';"&gt;ReplaceObject &lt;font face="Tahoma"&gt;method &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;font face="Tahoma"&gt;&lt;br /&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;NewTextVisualizer&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;DialogDebuggerVisualizer&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; Show(&lt;span style="color:#2b91af;"&gt;IDialogVisualizerService&lt;/span&gt; windowService, &lt;span style="color:#2b91af;"&gt;IVisualizerObjectProvider&lt;/span&gt; objectProvider)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;String&lt;/span&gt; sourceString = objectProvider.GetObject().ToString();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Form1&lt;/span&gt; form = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Form1&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;form.txtData.Text = sourceString;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;windowService.ShowDialog(form);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sourceString = form.txtData.Text;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:green;"&gt;//Replaces the debugee object with the debugger object.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (objectProvider.IsObjectReplaceable)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;objectProvider.ReplaceObject(sourceString);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 36pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Above is the normal code for creating a custom visualizer which uses the &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;ReplaceObject&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt; method.&amp;nbsp;This method replaces the object provided with the edited object, which makes this an editable visualizer.&lt;/span&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;(Added end result preview) :&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;img alt="Result" height="187" src="http://blogs.conchango.com/photos/conchango_bloggers/images/6220/original.aspx" style="width:318px;height:187px;" title="Result" width="318" /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;I have attached a sample solution with a custom Text Visualizer just to make sure that this works. For more details on creating and deploying visualizers &lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/e2zc529c.aspx"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Click here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;-Jomit&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=6206" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term=".Net" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/.Net/default.aspx" /><category term="Debugging" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Debugging/default.aspx" /><category term="Visualizers" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Visualizers/default.aspx" /></entry><entry><title>Using Windows Forms Controls in WPF Applications</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2007/02/28/Using-Windows-Forms-Controls-in-WPF-Applications.aspx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2007/02/28/Using-Windows-Forms-Controls-in-WPF-Applications.aspx</id><published>2007-02-28T09:35:00Z</published><updated>2007-02-28T09:35:00Z</updated><content type="html">&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;We all know that WPF provides a very rich environment for creating applications. But even though sometimes we may want to use windows forms controls to get some specific functionality. For Example you may want to use the DataGrid control or MaskEdit textbox in your WPF application, which is not currently in the control library of WPF. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.integration.aspx"&gt;WindowsFormsIntegration&lt;/a&gt; library helps us achieve this in a very easy way. Let&amp;rsquo;s see how:&lt;br /&gt;&lt;br /&gt;There are 2 important classes in this library&lt;/span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;ElementHost &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;and&lt;/span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;WindowsFormsHost&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;For instance, if you want to use the DataGrid control in your existing WPF application the first you need to do is add the reference to these assemblies:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;"&gt;&lt;span style="font-size:10pt;font-family:Symbol;"&gt;&lt;span&gt;&amp;middot;&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Windows Forms assembly.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpLast" style="margin:0cm 0cm 0pt 36pt;text-indent:-18pt;"&gt;&lt;span style="font-size:10pt;font-family:Symbol;"&gt;&lt;span&gt;&amp;middot;&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;WindowsFormsIntegration assembly. (The default location for this file is %programfiles%\Referencessemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll ) &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;And then write the following code to instantiate the control:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;XAML&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;p&gt;&amp;lt;&lt;font color="#a31515" size="2"&gt;Window&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;x:Class&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;WPFIntegration.Window1&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:x&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;WPFIntegration&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Height&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;300&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Width&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;300&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;Grid&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;Name&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;grid1&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Window&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;x:Class&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;WPFIntegration.Window1&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:x&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;WPFIntegration&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Height&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;300&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Width&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;300&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;Grid&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;Name&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;grid1&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;Grid&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;Window&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;C# Code&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;System.Windows.Forms.Integration.&lt;span style="color:#2b91af;"&gt;WindowsFormsHost&lt;/span&gt; frmHost = &lt;span style="color:blue;"&gt;new&lt;/span&gt; System.Windows.Forms.Integration.&lt;span style="color:#2b91af;"&gt;WindowsFormsHost&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;DataGrid&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt; myGrid = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;DataGrid&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;frmHost.Child = myGrid;&lt;br /&gt;&lt;span style="color:blue;"&gt;this&lt;/span&gt;.grid1.Children.Add(frmHost);&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Similarly we can also use WPF controls in Windows Forms using &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;font-family:'Courier New';"&gt;ElementHost.&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt; You can find more details &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.integration.elementhost.aspx"&gt;Here&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;There are few &lt;a href="http://msdn2.microsoft.com/en-us/library/ms744952.aspx"&gt;Layout Considerations&lt;/a&gt; for the WindowsFormsHost Element but&amp;nbsp;still I think it provides a good integration between both control libraries.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;-Jomit&lt;/span&gt;&lt;/p&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=6168" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="WPF" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/WPF/default.aspx" /><category term="WPF Integration" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/WPF+Integration/default.aspx" /><category term="WPF Interoperability" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/WPF+Interoperability/default.aspx" /></entry><entry><title>Interesting WPF Problem !!!</title><link rel="alternate" type="text/html" href="http://consultingblogs.emc.com/jomitvaghela/archive/2007/02/13/Interesting-WPF-Problem.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="456515" href="http://consultingblogs.emc.com/jomitvaghela/attachment/5948.ashx" /><id>http://consultingblogs.emc.com/jomitvaghela/archive/2007/02/13/Interesting-WPF-Problem.aspx</id><published>2007-02-13T12:58:00Z</published><updated>2007-02-13T12:58:00Z</updated><content type="html">&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:115%;"&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;I was creating a small WPF application and found an interesting thing while playing around with some properties and events. Let me first explain what the application does. &lt;em&gt;(I have also attached the code for more details)&lt;/em&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:115%;"&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:115%;"&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;It&amp;rsquo;s a simple application which lists down all the contacts from a text file and displays its details like first name, last name, email etc. I am using a&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:#2b91af;line-height:115%;font-family:'Courier New';"&gt;Contact&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;class to hold all the contact details and I am using a&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;PageFunction&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;to display the contact details on the main window. I have added a few more fancy things to it but that&amp;rsquo;s not relevant to this context.&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;The Main&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;Window&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;of the application has a&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;ListBox&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;on the left&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;DockPanel&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;which is bound with the contacts.txt file using&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;ObjectDataProvider. &lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;The right&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;DockPanel&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;displays a&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;PageFunction&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;on the&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Courier New';"&gt;ListItemSelected &lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;event of the&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;line-height:115%;font-family:'Courier New';"&gt;ListBox&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Tahoma','sans-serif';"&gt;, which displays the contact details&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:10pt;line-height:115%;font-family:'Arial','sans-serif';"&gt;&lt;img align="middle" alt="WPF Application" height="284" src="http://blogs.conchango.com/photos/conchango_bloggers/images/5951/425x284.aspx" style="width:425px;height:284px;" title="WPF Application" width="425" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;Initially the Main&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;Window&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;had the following xaml code&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Arial','sans-serif';"&gt;:&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;Window&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;x:Class&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;AddressBook.Window1&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;xmlns&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;xmlns:x&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;Title&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;AddressBook&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;Loaded&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;WindowLoaded&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;SizeToContent&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;WidthAndHeight&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinWidth&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;640&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinHeight&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;480&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:115%;"&gt;&lt;span style="font-size:10pt;color:blue;line-height:115%;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;gt;&lt;br /&gt;...&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:115%;"&gt;&lt;span style="font-size:10pt;color:blue;line-height:115%;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;The &lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;WindowLoaded&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt; &lt;span&gt;eventhandler contains the code to set the &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;DataContext &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;property of the left &lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;DockPanel&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Arial','sans-serif';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;to the contacts data. &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;private&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; WindowLoaded(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af;"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;text-indent:36pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;DockPanel_LeftPane.DataContext = &lt;span style="color:#2b91af;"&gt;Application&lt;/span&gt;.Current.Properties[&lt;span style="color:#a31515;"&gt;&amp;quot;ContactList&amp;quot;&lt;/span&gt;];&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;br /&gt;This code was working fine and I was getting the contact details of the first item when I started the application. Then I tried changing the width and height of the window to &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinWidth&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;1200&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt; &lt;span&gt;and &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinHeight&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;800&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt; and to my surprise the application stopped showing the contact details on the startup. I was only able to view the contact details once I clicked on the &lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;ListBox&lt;/span&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;item.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;I was playing with the values and when I changed it to &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinWidth&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;1079&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt; &lt;span&gt;and &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinHeight&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;800&lt;/span&gt;&amp;quot; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;it started working again!!!&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;I thought it might be something to do with the &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;SizeToContent &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;so I tried removing that but it again stopped working after removing it. I also tried various other things but it didn&amp;rsquo;t worked.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;So finally to make the code work with 1200 * 800 I added the &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;SizeChanged &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;eventhandler and wrote the same code as in the &lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;WindowLoaded &lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;eventhandler.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:10pt;color:#a31515;font-family:'Courier New';"&gt;Window&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt; &lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;x:Class&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;AddressBook.Window1&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;xmlns&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;xmlns:x&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;Title&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;AddressBook&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;Loaded&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;WindowLoaded&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;SizeChanged&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;WindowSizeChanged&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;SizeToContent&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;WidthAndHeight&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinWidth&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;1200&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:red;font-family:'Courier New';"&gt;MinHeight&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;quot;&lt;span style="color:blue;"&gt;800&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;I have no idea what the problem was?&lt;span&gt;&amp;nbsp; &lt;/span&gt;Why does the size of the window affect the loading of the data ? &lt;span&gt;&amp;nbsp;&lt;/span&gt;Is the SizeChanged event fired every time after the Loaded event and it just unbinds everything done in the Loaded event ? This can&amp;rsquo;t be possible but this is what&amp;rsquo;s happening!!&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;While I am still trying to find the problem, I thought to share this in case anyone can find something useful and make this understandable to me.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;All inputs are welcomed.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;-Jomit&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;tab-stops:7.1pt;"&gt;&lt;span style="font-size:10pt;font-family:'Tahoma','sans-serif';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://consultingblogs.emc.com/aggbug.aspx?PostID=5948" width="1" height="1"&gt;</content><author><name>Jomit.Vaghela</name><uri>http://consultingblogs.emc.com/members/Jomit.Vaghela.aspx</uri></author><category term="WPF" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/WPF/default.aspx" /><category term="Windows Presentation Foundation" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/Windows+Presentation+Foundation/default.aspx" /><category term="XAML" scheme="http://consultingblogs.emc.com/jomitvaghela/archive/tags/XAML/default.aspx" /></entry></feed>
