<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bryan Panjavan's Blog</title>
	<atom:link href="http://bpanjavan.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bpanjavan.wordpress.com</link>
	<description>ASP.NET / Silverlight Developer</description>
	<lastBuildDate>Wed, 25 Feb 2009 05:28:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bpanjavan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Bryan Panjavan's Blog</title>
		<link>http://bpanjavan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bpanjavan.wordpress.com/osd.xml" title="Bryan Panjavan&#039;s Blog" />
	<atom:link rel='hub' href='http://bpanjavan.wordpress.com/?pushpress=hub'/>
		<item>
		<title>New Blog Site!</title>
		<link>http://bpanjavan.wordpress.com/2009/02/25/new-blog-site/</link>
		<comments>http://bpanjavan.wordpress.com/2009/02/25/new-blog-site/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 05:28:18 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/2009/02/25/new-blog-site/</guid>
		<description><![CDATA[I finally got my domain and new blog site up, thanks many to DotNetBlogEngine. Please follow: http://www.bryanpanjavan.net/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=144&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I finally got my domain and new blog site up, thanks many to <a title="DotNetBlogEngine" href="http://www.dotnetblogengine.net/">DotNetBlogEngine</a>.</p>
<p>Please follow:</p>
<p><a title="Bryan Panjavan's Blog" href="http://www.bryanpanjavan.net/">http://www.bryanpanjavan.net/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=144&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2009/02/25/new-blog-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>
	</item>
		<item>
		<title>Financial Transaction System &#8211; A Silverlight 2.0 Line Of Business Application – Now Available</title>
		<link>http://bpanjavan.wordpress.com/2009/02/01/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-now-available/</link>
		<comments>http://bpanjavan.wordpress.com/2009/02/01/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-now-available/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 05:14:05 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=139</guid>
		<description><![CDATA[I finally got my new domain up and running.  This allows me to post the FTS application available for a beta release.  If you&#8217;re in a hurry, here it is: http://www.bryanpanjavan.net/FTS_Silverlight2/FTS_Silverlight2.html A couple of things to note about this &#8220;release&#8221;: In order to modularize this, I removed the connection to the web service which was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=139&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I finally got my new domain up and running.  This allows me to post the FTS application available for a beta release.  If you&#8217;re in a hurry, here it is:</p>
<p><a href="http://www.bryanpanjavan.net/FTS_Silverlight2/FTS_Silverlight2.html">http://www.bryanpanjavan.net/FTS_Silverlight2/FTS_Silverlight2.html</a></p>
<p>A couple of things to note about this &#8220;release&#8221;:</p>
<ul>
<li>In order to modularize this, I removed the connection to the web service which was updating the database on every command.</li>
<li>Instead, what you get is a default set of &#8220;dummy&#8221; data.  On an update the application fakes this and shows you the load screen anyways.  On a cancel, you&#8217;ll get the same initial set of &#8220;dummy&#8221; transactions.</li>
</ul>
<p>This post is one in a series featuring the FTS application. The original post for this series started here:</p>
<p><a href="http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/">http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/</a></p>
<p>More to come&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=139&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2009/02/01/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>
	</item>
		<item>
		<title>Financial Transaction System &#8211; A Silverlight 2.0 Line Of Business Application – Unit Testing</title>
		<link>http://bpanjavan.wordpress.com/2009/01/27/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-unit-testing/</link>
		<comments>http://bpanjavan.wordpress.com/2009/01/27/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-unit-testing/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 02:02:02 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[NUnit]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=115</guid>
		<description><![CDATA[  This post is about Test-Driven Development, and applying unit tests to the FTS business module. FYI this post is one in a series featuring the FTS application. The original post for this series started here: http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/ About Test-Driven Development Test-Driven Development is “catching” on. I write that with quotes and say that with air [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=115&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="mceTemp mceIEcenter" style="text-align:left;">
<div class="mceTemp mceIEcenter"> </div>
<p>This post is about <a title="TDD" href="http://en.wikipedia.org/wiki/Test_driven_development">Test-Driven Development</a>, and applying unit tests to the FTS business module.</div>
<p>FYI this post is one in a series featuring the FTS application. The original post for this series started here: <a href="http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/">http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/</a></p>
<p><strong>About Test-Driven Development </strong></p>
<p>Test-Driven Development is “catching” on. I write that with quotes and say that with air quotes because there’s a formality to everything, and I have yet to see a project apply truly test-driven development at a macro and micro level. It’s hard.</p>
<p>At a macro level, truly Test-Driven Development involves detailed requirements (told you it was hard) and formal test cases, able to be read, and understood by manual testers. These testers execute their test cases throughout the development cycle and most importantly at the end of the cycle. Caution must be taken. As requirements inevitably change, these test cases must be maintained. At the end of each cycle, the completion and passing of the test cases is what decides the completion and correctness of the code in the cycle.</p>
<p>At a micro level is where it gets fun / tedious for developers. True micro-unit testing is very strict. It involves writing your unit tests as you write your code. More specifically, write a unit test for every little piece of functionality that you’re going to code just before you code it. This ensures that you’ve got near comprehensive coverage of your code, and you’ll have a plethora of tests you can re-use. Yeah, let’s do this.</p>
<p>There are a number of testing frameworks. Among the most popular are <a title="NUnit" href="http://www.nunit.org/index.php">NUnit</a>, <a title="MBUnit" href="http://www.mbunit.com/">MBUnit</a>, and <a title="MS Test" href="http://msdn.microsoft.com/en-us/library/ms243147(VS.80).aspx">MS Test</a>, which is Microsoft Visual Studio 2008’s built in testing framework. For this example, I’m using NUnit.</p>
<p><strong>Code Sample – Unit Testing </strong></p>
<p>Before I even create my FTSCategory class, I create my FTSCategoryTest class and my first test. Notice three things. I’ve imported the NUnit namespace. The test class is decorated with the TestFixtureAttribute. Each test is decorated with the TestAttribute. Each test should contain one assertion. Having a few is not illegal, but it’s strongly encouraged that each test method only contain one so if the test fails, you don’t have to guess which assertion failed.</p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">using</span><span style="font-size:9pt;font-family:&quot;"> NUnit.Framework;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">namespace</span><span style="font-size:9pt;font-family:&quot;"> FTS.BusinessNUnitTest<br />
{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span> </span><span> </span>[<span style="color:#2b91af;">TestFixture</span>]</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span> </span><span> </span><span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">FTSCategoryTest</span> : <span style="color:#2b91af;">AssertionHelper</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span> </span><span> </span>{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>   </span><span> </span>[<span style="color:#2b91af;">Test</span>]</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>   </span><span> </span><span style="color:blue;">public</span> <span style="color:blue;">void</span> InitializeCategoryTest()</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>   </span><span> </span>{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>     </span><span> </span><span style="color:#2b91af;">FTSCategory</span> ftsCategory = <span style="color:#2b91af;">FTSCategory</span>.ReturnFTSCategory(1000, <span style="color:#a31515;">&#8220;Diamond&#8221;</span>);</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>   </span><span>  </span><span> </span><span style="color:#2b91af;">Assert</span>.IsNotNull(ftsCategory);</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:small;font-family:&quot;"><span> </span><span>  </span><span> </span>}</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:small;"><span style="font-family:Calibri;"><span> </span><span> </span><span> </span><span> </span>}</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:Calibri;">}</span></p>
<p><span style="font-size:9pt;font-family:&quot;">Obviously it won’t run.<span>  </span>It won’t even compile.<span>  </span>Good.<span>  </span>Now let’s write some bare minimum code by creating our FTSCategory class and coding the ReturnFTSCategory method.<span>   </span></span></p>
<p> </p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';">namespace</span><span style="font-size:9pt;font-family:'Courier New';"> FTS.Business</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';">{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';"><span>  </span>public</span><span style="font-size:9pt;font-family:'Courier New';"> <span style="color:blue;">int</span> FTSCategoryID { <span style="color:blue;">get</span>; <span style="color:blue;">private</span> <span style="color:blue;">set</span>; }</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:blue;">public</span> <span style="color:blue;">string</span> Name { <span style="color:blue;">get</span>; <span style="color:blue;">private</span> <span style="color:blue;">set</span>; }</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:#2b91af;">FTSCategory</span> ReturnFTSCategory(<span style="color:blue;">int</span> ftsCategoryID, <span style="color:blue;">string</span> name) </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span>{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span>  </span><span style="color:blue;">return</span> <span style="color:blue;">null</span>;<span>    </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span>}</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';">}</span></p>
<p> This should get it to compile.</p>
<p> <span style="font-size:9pt;font-family:&quot;">Notice one thing.<span>  </span>The namespace of by business class is different than that of my test class.<span>  </span>Another important characteristic of testing is that your test project should be completely separate of the project that you’re testing.<span>  </span>This maintains a clear encapsulation of responsibilities.<span>  </span>Now let’s run the test using NUnit’s GUI.</span></p>
<div class="mceTemp mceIEcenter" style="text-align:left;">
<div id="attachment_118" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2009/01/firstfailedtest1.jpg"><img class="size-full wp-image-118" title="FailedTest" src="http://bpanjavan.files.wordpress.com/2009/01/firstfailedtest1.jpg?w=450&#038;h=202" alt="Failed Test" width="450" height="202" /></a><p class="wp-caption-text">Failed Test</p></div>
<p> <span style="font-size:9pt;">It failed.<span>  </span>Good.<span>  </span>One of the most important characteristics of writing your unit tests is that you make them fail before you make them pass.<span>  </span>That way you can be sure that you’re not writing happy unit tests that always pass.<span>  </span>Let’s make this one pass.</span></p>
<p> </p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';">namespace</span><span style="font-size:9pt;font-family:'Courier New';"> FTS.Business</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';">{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';"><span>  </span>public</span><span style="font-size:9pt;font-family:'Courier New';"> <span style="color:blue;">int</span> FTSCategoryID { <span style="color:blue;">get</span>; <span style="color:blue;">private</span> <span style="color:blue;">set</span>; }</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:blue;">public</span> <span style="color:blue;">string</span> Name { <span style="color:blue;">get</span>; <span style="color:blue;">private</span> <span style="color:blue;">set</span>; }</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:#2b91af;">FTSCategory</span> ReturnFTSCategory(<span style="color:blue;">int</span> ftsCategoryID, <span style="color:blue;">string</span> name) </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span>{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span>  </span><span style="color:blue;">return</span> <span style="color:blue;">new</span> <span style="color:#2b91af;">FTSCategory</span>();<span>    </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span>}</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';">}</span></p>
<p><span style="font-size:9pt;">That should pass our original “not null” assertion.<span>  </span>Now lather, rinse, and repeat.<span>  </span>Re-run our unit test and this time it should pass.</span></p>
<p> </p>
<div id="attachment_119" class="wp-caption aligncenter" style="width: 459px"><a href="http://bpanjavan.files.wordpress.com/2009/01/firstpassedtest.jpg"><img class="size-full wp-image-119" title="PassingTest" src="http://bpanjavan.files.wordpress.com/2009/01/firstpassedtest.jpg?w=449&#038;h=156" alt="Passing Test" width="449" height="156" /></a><p class="wp-caption-text">Passing Test</p></div>
<p class="MsoNormal" style="margin:0 0 10pt;">So now, we write our next test.<span>  </span>Let’s ensure that the new FTSCategory ID and name are equal to the ones we pass in.<span>  </span>If you’re <a title="OCD" href="http://en.wikipedia.org/wiki/Obsessive-compulsive_disorder">OCD</a> you can split this into two tests.</p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';">[<span style="color:#2b91af;">Test</span>]</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';">public</span><span style="font-size:9pt;font-family:'Courier New';"> <span style="color:blue;">void</span> CheckCategoryValuesTest()</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';">{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';"><span>  </span>int</span><span style="font-size:9pt;font-family:'Courier New';"> id = 1000;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:blue;">string</span> name = <span style="color:#a31515;">&#8220;Diamond&#8221;</span>;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:#2b91af;">FTSCategory</span> ftsCategory = <span style="color:#2b91af;">FTSCategory</span>.ReturnFTSCategory(id, name);</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:#2b91af;">Assert</span>.AreEqual(id, ftsCategory.FTSCategoryID, <span style="color:#a31515;">&#8220;ID&#8217;s are not equal&#8221;</span>);</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';"><span>  </span><span style="color:#2b91af;">StringAssert</span>.IsMatch(name, ftsCategory.Name, <span style="color:#a31515;">&#8220;Names do not match&#8221;</span>);</span></p>
<p class="MsoNormal" style="background:#d9d9d9;margin:0 0 10pt;"><span style="font-size:9pt;line-height:115%;font-family:'Courier New';">}</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;">Run all tests again and they will fail.<span>  </span>Now we can go back and once again add the bare minimum we need to make them pass.</p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';">public</span><span style="font-size:9pt;font-family:'Courier New';"> <span style="color:blue;">static</span> <span style="color:#2b91af;">FTSCategory</span> ReturnFTSCategory(<span style="color:blue;">int</span> ftsCategoryID, <span style="color:blue;">string</span> name) </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:'Courier New';">{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:'Courier New';"><span>  </span>return</span><span style="font-size:9pt;font-family:'Courier New';"> <span style="color:blue;">new</span> <span style="color:#2b91af;">FTSCategory</span>(){ FTSCategoryID = ftsCategoryID, Name = name };<span>    </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;margin:0 0 10pt;"><span style="font-size:9pt;line-height:115%;font-family:'Courier New';">}</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;">Once again, we write the bare minimum, re-run our test, and we’re back in the green zone.</p>
<p class="MsoNormal" style="margin:0 0 10pt;"><strong>Conclusion</strong></p>
<p class="MsoNormal" style="margin:0 0 10pt;">First off, I’ve only touched the tip of the iceberg regarding the unit testing capabilities of NUnit.<span>  </span>There are attributes you can use to test for an expected exception in your method.<span>  </span>You can assert many different things, including comparing collections, and several different ways to compare strings.<span>  </span></p>
<p class="MsoNormal" style="margin:0 0 10pt;">Notice that we wrote the BARE minimum code that we needed to pass each test.<span>  </span>While it appears that writing unit tests may be a time taking process, there’s an <a title="ROI" href="http://en.wikipedia.org/wiki/Rate_of_return">ROI</a> here.<span>  </span>Doing this ensures that your developers aren’t cowboy coding and bloating their application any more than they have to.</p>
<p class="MsoNormal" style="margin:0 0 10pt;">The last point is vital.<span>  </span>It’s no secret that refactoring requires re-testing.<span>  </span>1 month down the road when you’re re-factoring your code, you’ll be glad that you have a plethora of unit tests on hand to ensure that you haven’t broken any functionality.<span>  </span>This is the ultimate return on investment of unit testing.</p>
<p class="MsoNormal" style="margin:0 0 10pt;"> </p>
<p class="MsoNormal" style="margin:0 0 10pt;">More to come…</p>
<p> </p>
<p> </p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=115&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2009/01/27/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/firstfailedtest1.jpg" medium="image">
			<media:title type="html">FailedTest</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/firstpassedtest.jpg" medium="image">
			<media:title type="html">PassingTest</media:title>
		</media:content>
	</item>
		<item>
		<title>Financial Transaction System &#8211; A Silverlight 2.0 Line Of Business Application – Silverlight Styles</title>
		<link>http://bpanjavan.wordpress.com/2009/01/19/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-silverlight-styles/</link>
		<comments>http://bpanjavan.wordpress.com/2009/01/19/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-silverlight-styles/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 02:25:27 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=96</guid>
		<description><![CDATA[When it comes to web applications, one of the best characteristics in terms of customizing the user interface is the ability to modularize the look and feel using CSS style sheets.  Silverlight 2.0 emulates this functionality with the use of &#60;Style /&#62; resources, and takes it 10 steps further by allowing you to set type-specific [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=96&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div></div>
<p><span style="font-size:small;font-family:Calibri;"></p>
<p class="MsoNormal" style="margin:0 0 10pt;">When it comes to web applications, one of the best characteristics in terms of customizing the user interface is the ability to modularize the look and feel using CSS style sheets.<span>  </span>Silverlight 2.0 emulates this functionality with the use of &lt;Style /&gt; resources, and takes it 10 steps further by allowing you to set type-specific properties and complete visual template control.<span>  </span>That last one tends to go over most peoples’ heads, but we’ll get into it in a few paragraphs.</p>
<p class="MsoNormal" style="margin:0 0 10pt;">First, we’ll take a look at a basic example of Silverlight 2.0 &lt;Style/&gt; elements.<span>  </span>A common property among Silverlight 2.0 controls is <em>Background</em>.<span>  </span>The main placeholder control is a <em>Grid</em> entitled “gridMain”.<span>  </span>Below is a sample of setting the <em>Background</em> property of this control.</p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:9pt;color:red;font-family:&quot;"> x</span><span style="font-size:9pt;color:blue;font-family:&quot;">:</span><span style="font-size:9pt;color:red;font-family:&quot;">Name</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;gridMain&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> ShowGridLines</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;False&#8221;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:red;font-family:&quot;"><span>  </span>Background</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Green&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;"><span>  </span>…<span>    </span></span><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>        </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;">I can take this property into a style declaration that I place within the &lt;UserControl.Resources/&gt; section of my page.</p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:red;font-family:&quot;"> x</span><span style="font-size:9pt;color:blue;font-family:&quot;">:</span><span style="font-size:9pt;color:red;font-family:&quot;">Name</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;FTSMainGrid&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> TargetType</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Grid&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:red;font-family:&quot;"> Property</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Background” </span><span style="font-size:9pt;color:red;font-family:&quot;">Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Green&#8221; /&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;">&lt;Setter/&gt; also supports setting styles for complex properties:</p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:red;font-family:&quot;"> x</span><span style="font-size:9pt;color:blue;font-family:&quot;">:</span><span style="font-size:9pt;color:red;font-family:&quot;">Name</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;FTSMainGrid&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> TargetType</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Grid&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;"><span>  </span>&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:red;font-family:&quot;"> Property</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Background&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter.Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>    </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">SolidColorBrush</span><span style="font-size:9pt;color:red;font-family:&quot;"> Color</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Green&#8221;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>    </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter.Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;">Notice a few things.<span>  </span>Like a CSS style class, I give this style a name that can be referenced by my control.<span>  </span>However, I have the option of NOT giving it a name, which will result in this style being applied to ALL controls of type <em>Grid </em>under this scope.<span>  </span>This brings me to the next point.<span>  </span>The <em>TargetType</em> property specifies that this style can only be applied to controls of type <em>Grid</em>.<span>  </span>This must have been a tough decision for the Silverlight team.<span>  </span>This appears to be a drawback, because you cannot apply this style to other controls, and each would need their own style.<span>  </span>However, it is this strong typing that allows for type-specific property settings in Silverlight 2.0 styles, which we’ll get into next.</p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;">First, let’s see how “gridMain” references this style:</p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:9pt;color:red;font-family:&quot;"> x</span><span style="font-size:9pt;color:blue;font-family:&quot;">:</span><span style="font-size:9pt;color:red;font-family:&quot;">Name</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;gridMain&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> ShowGridLines</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;False&#8221;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:red;font-family:&quot;"><span>  </span>Style</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;{</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">StaticResource</span><span style="font-size:9pt;color:red;font-family:&quot;"> FTSMainGrid</span><span style="font-size:9pt;color:blue;font-family:&quot;">}&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;"><span>  </span>…</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;">I repeat this process for other controls in my application, such as the Button, and ListBox.<span>  </span><span> </span>The result is below:</p>
<p class="MsoNormal" style="margin:0 0 10pt;"> </p>
<p> </p>
<p></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"> </p>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2009/01/styles_green.jpg"><img class="size-full wp-image-97" title="Green Style" src="http://bpanjavan.files.wordpress.com/2009/01/styles_green.jpg?w=450&#038;h=237" alt="Green Style" width="450" height="237" /></a><p class="wp-caption-text">Green Style</p></div>
<div></div>
<p><span style="font-size:small;font-family:Calibri;"></p>
<p class="MsoNormal" style="line-height:normal;margin:0;">Silverlight 2.0 supports type-specific properties when setting control styles.<span>  </span>In other words, all controls have a different set of properties that they support.<span>  </span>CSS did not make this distinction.<span>  </span>Instead, in all CSS style classes, you were given a very broad general set of style properties that may or may not apply to all controls.<span>  </span>In the example below, the &lt;Style/&gt; element is set for the Silverlight 2.0 <em>DataGrid</em>.<span>  </span>The <em>DataGrid</em> supports the properties <em>RowBackground</em> and <em>AlternatingRowBackground</em>, which no other control (that I can recall) supports, which makes sense.</p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:red;font-family:&quot;"> x</span><span style="font-size:9pt;color:blue;font-family:&quot;">:</span><span style="font-size:9pt;color:red;font-family:&quot;">Name</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;ModuleDataGrid&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> TargetType</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;DataGrid&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;"><span>  </span>&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:red;font-family:&quot;"> Property</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;RowBackground&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;#000066&#8243;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:red;font-family:&quot;"> Property</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;AlternatingRowBackground&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;#003366&#8243;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;">The resulting DataGrid:</p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p> </p>
<p></span></p>
<div id="attachment_112" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2009/01/styles_datagrid2.jpg"><img class="size-full wp-image-112" title="DataGrid" src="http://bpanjavan.files.wordpress.com/2009/01/styles_datagrid2.jpg?w=450&#038;h=144" alt="DataGrid" width="450" height="144" /></a><p class="wp-caption-text">DataGrid</p></div>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:small;font-family:Calibri;">Finally, in a move I can only call the Pandora’s Box of WPF and Silverlight 2.0, most if not all styles support full visual template control.<span>  </span>Not only can you customize decorative properties of controls such as background, size, etc., but now you can customize the base visual template of the control.<span>  </span>In the FTSTransaction module, I’ve created a style which overrides the default template of the <em>Button</em> class.<span>  </span>This is to be used for my “Add” button:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:red;font-family:&quot;"> x</span><span style="font-size:9pt;color:blue;font-family:&quot;">:</span><span style="font-size:9pt;color:red;font-family:&quot;">Name</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;FTSAddButton&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> TargetType</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Button&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;"><span>  </span>&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:red;font-family:&quot;"> Property</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Template&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter.Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>    </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">ControlTemplate</span><span style="font-size:9pt;color:red;font-family:&quot;"> TargetType</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Button&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>      </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>        </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Rectangle</span><span style="font-size:9pt;color:red;font-family:&quot;"> Width</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;15&#8243;</span><span style="font-size:9pt;color:red;font-family:&quot;"> Height</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;45&#8243;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>          </span><span>  </span><span style="color:red;">Fill</span><span style="color:blue;">=&#8221;Navy&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>          </span><span style="color:blue;">/&gt;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>          </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Rectangle</span><span style="font-size:9pt;color:red;font-family:&quot;"> Width</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;45&#8243;</span><span style="font-size:9pt;color:red;font-family:&quot;"> Height</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;15&#8243;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>          </span><span>  </span><span style="color:red;">Fill</span><span style="color:blue;">=&#8221;Navy&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>          </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Rectangle</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>        </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">ContentPresenter</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>        </span><span>  </span><span>  </span><span style="color:red;">Content</span><span style="color:blue;">=&#8221;{</span><span style="color:#a31515;">TemplateBinding</span><span style="color:red;"> Content</span><span style="color:blue;">}&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>          </span><span>  </span><span style="color:red;">ContentTemplate</span><span style="color:blue;">=&#8221;{</span><span style="color:#a31515;">TemplateBinding</span><span style="color:red;"> ContentTemplate</span><span style="color:blue;">}&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>          </span><span>  </span><span style="color:red;">Margin</span><span style="color:blue;">=&#8221;{</span><span style="color:#a31515;">TemplateBinding</span><span style="color:red;"> Margin</span><span style="color:blue;">}&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>          </span><span>  </span><span style="color:red;">HorizontalAlignment</span><span style="color:blue;">=&#8221;{</span><span style="color:#a31515;">TemplateBinding</span><span style="color:red;"> HorizontalContentAlignment</span><span style="color:blue;">}&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>          </span><span>  </span><span style="color:red;">VerticalAlignment</span><span style="color:blue;">=&#8221;{</span><span style="color:#a31515;">TemplateBinding</span><span style="color:red;"> VerticalContentAlignment</span><span style="color:blue;">}&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;font-family:&quot;"><span>        </span><span>  </span><span style="color:blue;">/&gt;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>      </span><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>      </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">ControlTemplate</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>    </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter.Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:red;font-family:&quot;"> Property</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;Foreground&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;White&#8221;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Setter</span><span style="font-size:9pt;color:red;font-family:&quot;"> Property</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;FontWeight&#8221;</span><span style="font-size:9pt;color:red;font-family:&quot;"> Value</span><span style="font-size:9pt;color:blue;font-family:&quot;">=&#8221;bold&#8221;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:9pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:9pt;color:#a31515;font-family:&quot;">Style</span><span style="font-size:9pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:small;font-family:Calibri;">Whatever I draw now becomes the default template of my <em>Button</em>.<span>  </span>The &lt;ContentPresenter /&gt; element is then used to present the same content that would appear on my button in the first place.<span>  </span>In this case, it is the text of the button.<span>  </span>I’ve done something similar to my “Delete” button and the result is below:</span></p>
<div></div>
<p><span style="font-size:small;font-family:Calibri;"></p>
<div id="attachment_101" class="wp-caption aligncenter" style="width: 304px"><a href="http://bpanjavan.files.wordpress.com/2009/01/styles_buttontemplates.jpg"><img class="size-full wp-image-101" title="Button Templates" src="http://bpanjavan.files.wordpress.com/2009/01/styles_buttontemplates.jpg?w=294&#038;h=119" alt="Button Templates" width="294" height="119" /></a><p class="wp-caption-text">Button Templates</p></div>
<p> </p>
<p></span></p>
<p><span style="font-size:11pt;font-family:&quot;">Just for kicks, here are two different color styles applied to my application; green being the original, and blue being my second style.</span></p>
<p> </p>
<div></div>
<p><span style="font-size:small;font-family:Calibri;"></p>
<div id="attachment_102" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2009/01/styles_allgreen.jpg"><img class="size-full wp-image-102" title="All Green" src="http://bpanjavan.files.wordpress.com/2009/01/styles_allgreen.jpg?w=450&#038;h=287" alt="All Green" width="450" height="287" /></a><p class="wp-caption-text">All Green</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p></span></p>
<div id="attachment_103" class="wp-caption aligncenter" style="width: 459px"><a href="http://bpanjavan.files.wordpress.com/2009/01/styles_allblue.jpg"><img class="size-full wp-image-103" title="All Blue" src="http://bpanjavan.files.wordpress.com/2009/01/styles_allblue.jpg?w=449&#038;h=287" alt="All Blue" width="449" height="287" /></a><p class="wp-caption-text">All Blue</p></div>
<p><span style="font-size:small;font-family:Calibri;">More to come…</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=96&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2009/01/19/financial-transaction-system-a-silverlight-20-line-of-business-application-%e2%80%93-silverlight-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/styles_green.jpg" medium="image">
			<media:title type="html">Green Style</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/styles_datagrid2.jpg" medium="image">
			<media:title type="html">DataGrid</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/styles_buttontemplates.jpg" medium="image">
			<media:title type="html">Button Templates</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/styles_allgreen.jpg" medium="image">
			<media:title type="html">All Green</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/styles_allblue.jpg" medium="image">
			<media:title type="html">All Blue</media:title>
		</media:content>
	</item>
		<item>
		<title>Financial Transaction System &#8211; A Silverlight 2.0 Line Of Business Application</title>
		<link>http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/</link>
		<comments>http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 23:09:22 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=64</guid>
		<description><![CDATA[Introduction This post is the first in a series showcasing the FTS (Financial Transaction System) mini-application.  FTS is a project I developed, front end to back, web app. to database, start to finish.  In the near future I intend to cover some of the technologies and topics used in this application, including Silverlight 2.0, ASP.NET [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=64&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_65" class="wp-caption aligncenter" style="width: 459px"><img class="size-full wp-image-65" title="Silverlight 2.0 FTS Transactions" src="http://bpanjavan.files.wordpress.com/2009/01/silverlight_ftstransactions.jpg?w=449&#038;h=294" alt="Silverlight 2.0 FTS Transactions" width="449" height="294" /><p class="wp-caption-text">Silverlight 2.0 FTS Transactions</p></div>
<p><strong>Introduction</strong></p>
<p>This post is the first in a series showcasing the FTS (Financial Transaction System) mini-application.  FTS is a project I developed, front end to back, web app. to database, start to finish.  In the near future I intend to cover some of the technologies and topics used in this application, including Silverlight 2.0, ASP.NET 3.5, ASP.NET AJAX, ADO.NET Data Services, and ASP.NET Unit Testing.  Today&#8217;s topic is Silverlight 2.0.</p>
<p>Here is a screen cast if you&#8217;re in a hurry to see it in action. </p>
<p><a class="alignleft" title="FTS Silverlight 2.0" href="http://wfmxpg.bay.livefilestore.com/y1ppSnPI2DHfT8a6KdsBU9Xm3x9nrAlCyPTCzhA21amrBMTw-xVNOntkDI0j5kwvzZWQZ8qFCQwDYaeozRy2_Jcvg/FTS_Silverlight2.zip?download" target="_self">FTS Silverlight 2.0</a></p>
<p> </p>
<p>The user manipulates Categories in the first module, then proceeds to the second module, Transactions.  Transactions are classified by Category, and can be added / deleted / updated.  The user can edit Transaction information such as the date, description, and amount. Then when ready to update, the user clicks &#8220;Apply&#8221; to update all Transactions at once.</p>
<p><strong>History</strong></p>
<p>The DotNet BaseLine project is an initiative started by a colleague of mine at Sogeti USA, Amir Rajan, as part of our internal DotNet training and development.  The idea is that based on a given set of requirements, our consultants would individually develop the fully functioning application from front end to back.  While the database was to be done in SQL, and the class libraries done in DotNet 3.5, the front end was up to each individual consultant to choose.  We&#8217;ve seen some consultants develop this as a Windows Application, and some as a Web Application using the MVC framework.  In my first iteration, I chose to develop this as an ASP.NET web application.  But shortly after that, Silverlight 2.0 was publicly released with an incredibly expanded runtime over Silverlight 1.0, with new data driven capabilities that rival ASP.NET.  I saw an opportunity to revamp FTS with a much more rich and responsive presentation.</p>
<p><strong>Code Sample &#8211; Retreiving Data using WCF Web Service Proxy</strong></p>
<p>In terms of data retrieval and communication, Silverlight 2.0 uses a web client or proxy to access ASP.NET WCF (Windows Communication Foundation) web services.  The WCF web service, FTSWCFWebService, provides the data for our application. </p>
<div id="attachment_74" class="wp-caption aligncenter" style="width: 313px"><img class="size-full wp-image-74" title="Silverlight 2.0 WebSite WCF Web Service" src="http://bpanjavan.files.wordpress.com/2009/01/silverlight_website_wcfwebservice1.jpg?w=303&#038;h=341" alt="Silverlight 2.0 WebSite WCF Web Service" width="303" height="341" /><p class="wp-caption-text">Silverlight 2.0 WebSite WCF Web Service</p></div>
<p>The code snippet below shows the business entity class, FTSTransactionList, making an asynchronous call using a web client proxy for FTSWCFWebService.  Before the call is made, an event handler is added matching the delegate for the return call of the WCF web service.  On the return, the event argument is checked for errors before attempting to process the data contained in the Result property.</p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:'Courier New';">public</span><span style="font-size:8pt;font-family:'Courier New';"> <span style="color:blue;">void</span> Load()</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';">{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:#2b91af;font-family:'Courier New';"><span>  </span>FTSWCFWebServiceClient</span><span style="font-size:8pt;font-family:'Courier New';"> ftsWCFService = <span style="color:blue;">new</span> <span style="color:#2b91af;">FTSWCFWebServiceClient</span>();</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>ftsWCFService.FTSTransactionList_GetManyXMLCompleted </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>    </span>+= <span style="color:blue;">new</span> <span style="color:#2b91af;">EventHandler</span>&lt;<span style="color:#2b91af;">FTSTransactionList_GetManyXMLCompletedEventArgs</span>&gt;(GetManyXMLCompleted);</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>ftsWCFService.FTSTransactionList_GetManyXMLAsync();<span>          </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';">}</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:'Courier New';">void</span><span style="font-size:8pt;font-family:'Courier New';"> GetManyXMLCompleted(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">FTSTransactionList_GetManyXMLCompletedEventArgs</span> e)</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';">{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:'Courier New';"><span>  </span>if</span><span style="font-size:8pt;font-family:'Courier New';"> (e.Error == <span style="color:blue;">null</span>)</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span><span>  </span><span style="color:blue;">string</span> result = e.Result;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:green;font-family:'Courier New';"><span>    </span>//Process result</span><span style="font-size:8pt;font-family:'Courier New';"><span>            </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>}</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span><span style="color:blue;">else</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span><span>  </span><span style="color:blue;">throw</span> e.Error;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>}</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';">}</span></p>
<p><strong>Code Sample &#8211; Loading a Datagrid</strong></p>
<p>FTSTransactionList derrives from an ASP.NET Generic List of FTSTransaction objects.  The list is loaded with the data from the call to the WCF web service.  The details on how this is done have been omitted because that is not the focus of this sample.</p>
<p> </p>
<div id="attachment_77" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2009/01/fts_silverlight_2_classdiagram1.jpg"><img class="size-full wp-image-77" title="FTS Silverlight 2.0 Class Diagram" src="http://bpanjavan.files.wordpress.com/2009/01/fts_silverlight_2_classdiagram1.jpg?w=450&#038;h=264" alt="FTS Silverlight 2.0 Class Diagram" width="450" height="264" /></a><p class="wp-caption-text">FTS Silverlight 2.0 Class Diagram</p></div>
<p>This list will be used as the source for our datagrid.  Below is the XAML markup.  The WPF / Silverlight datagrid is remarkably similar to the ASP.NET gridview control.  A variety of columns can be defined, such as text columns or check box columns, or custom template columns for flexibility.</p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGrid</span><span style="font-size:8pt;color:red;font-family:&quot;"> x</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:red;font-family:&quot;">Name</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;datagridTransactions&#8221;</span><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"> </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:&quot;"><span><span style="color:#000000;">  </span></span><span style="color:red;">AutoGenerateColumns</span><span style="color:blue;">=&#8221;False&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:red;font-family:&quot;"><span>  </span>SelectionMode</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;Single&#8221; </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>  </span></span><span style="font-size:8pt;color:red;font-family:&quot;">LoadingRow</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;datagridTransactions_LoadingRow&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>  </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGrid.Columns</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:#a31515;font-family:&quot;"><span>  </span><span>  </span></span><span style="font-size:8pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGridTextColumn</span><span style="font-size:8pt;color:red;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:red;font-family:&quot;"><span>      </span>Header</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;Transaction Date&#8221;</span><span style="font-size:8pt;color:red;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:red;font-family:&quot;"><span>      </span>Binding</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;{</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">Binding</span><span style="font-size:8pt;color:red;font-family:&quot;"> DateOfTransaction</span><span style="font-size:8pt;color:blue;font-family:&quot;">,</span><span style="font-size:8pt;color:red;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:red;font-family:&quot;"><span>        </span>Converter</span><span style="font-size:8pt;color:blue;font-family:&quot;">={</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">StaticResource</span><span style="font-size:8pt;color:red;font-family:&quot;"> DateConverter</span><span style="font-size:8pt;color:blue;font-family:&quot;">}}&#8221;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>    </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGridTemplateColumn</span><span style="font-size:8pt;color:red;font-family:&quot;"> Header</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;Category&#8221;&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>    </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGridTemplateColumn.CellTemplate</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>      </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataTemplate</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>        </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>          </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">Grid.ColumnDefinitions</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>            </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">ColumnDefinition</span><span style="font-size:8pt;color:red;font-family:&quot;"> MinWidth</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;50&#8243;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>            </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">ColumnDefinition</span><span style="font-size:8pt;color:red;font-family:&quot;"> MinWidth</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;1&#8243;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:#a31515;font-family:&quot;"><span>          </span></span><span style="font-size:8pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">Grid.ColumnDefinitions</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>        </span><span>  </span>&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">ComboBox</span><span style="font-size:8pt;color:red;font-family:&quot;"> x</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:red;font-family:&quot;">Name</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;comboboxCategories&#8221;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"><span>        </span><span>  </span><span>  </span></span><span style="color:red;">Grid.ColumnSpan</span><span style="color:blue;">=&#8221;2&#8243;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"><span>        </span><span>  </span><span>  </span></span><span style="color:red;">DisplayMemberPath</span><span style="color:blue;">=&#8221;Name&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"><span>        </span><span>  </span><span>  </span></span><span style="color:red;">SelectionChanged</span><span style="color:blue;">=&#8221;comboboxCategories_SelectionChanged&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"><span>        </span><span>  </span><span>  </span></span><span style="color:red;">Loaded</span><span style="color:blue;">=&#8221;comboboxCategories_Loaded&#8221;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"><span>        </span><span>  </span><span>  </span></span><span style="color:red;">DropDownClosed</span><span style="color:blue;">=&#8221;comboboxCategories_DropDownClosed&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>        </span><span>  </span>&lt;/</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">ComboBox</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>        </span>&lt;/</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">Grid</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>      </span>&lt;/</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataTemplate</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:#a31515;font-family:&quot;"><span>    </span></span><span style="font-size:8pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGridTemplateColumn.CellTemplate</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:8pt;color:blue;font-family:&quot;">&lt;/</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGridTemplateColumn</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:8pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGridTextColumn</span><span style="font-size:8pt;color:red;font-family:&quot;"> Header</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;Description&#8221;</span><span style="font-size:8pt;color:red;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:red;font-family:&quot;"><span>    </span>Binding</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;{</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">Binding</span><span style="font-size:8pt;color:red;font-family:&quot;"> Description</span><span style="font-size:8pt;color:blue;font-family:&quot;">}&#8221; </span><span style="font-size:8pt;color:red;font-family:&quot;">MinWidth</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;250&#8243;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:#a31515;font-family:&quot;"><span>  </span></span><span style="font-size:8pt;color:blue;font-family:&quot;">&lt;</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGridTextColumn</span><span style="font-size:8pt;color:red;font-family:&quot;"> Header</span><span style="font-size:8pt;color:blue;font-family:&quot;">=&#8221;Amount&#8221;</span><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"> </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:&quot;"><span style="color:#000000;"><span>  </span><span>  </span></span><span style="color:red;">Binding</span><span style="color:blue;">=&#8221;{</span><span style="color:#a31515;">Binding</span><span style="color:red;"> Amount</span><span style="color:blue;">,</span><span style="color:red;"> </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:red;font-family:&quot;"><span>      </span>Converter</span><span style="font-size:8pt;color:blue;font-family:&quot;">={</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">StaticResource</span><span style="font-size:8pt;color:red;font-family:&quot;"> ShortDecimalConverter</span><span style="font-size:8pt;color:blue;font-family:&quot;">}}&#8221;/&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:&quot;"><span>  </span>&lt;/</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;font-family:&quot;">DataGrid.Columns</span><span style="font-size:8pt;color:blue;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;margin:0 0 10pt;"><span style="font-size:8pt;color:blue;line-height:115%;font-family:&quot;">&lt;/</span><span style="font-size:8pt;color:#a31515;line-height:115%;font-family:&quot;">data</span><span style="font-size:8pt;color:blue;line-height:115%;font-family:&quot;">:</span><span style="font-size:8pt;color:#a31515;line-height:115%;font-family:&quot;">DataGrid</span><span style="font-size:8pt;color:blue;line-height:115%;font-family:&quot;">&gt;</span></p>
<p> Set the source using the ItemsSource property.  </p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:'Courier New';">private</span><span style="font-size:8pt;font-family:'Courier New';"> <span style="color:blue;">void</span> BindFTSTransactionList()</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';">{</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;color:blue;font-family:'Courier New';"><span>  </span></span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>datagridTransactions.ItemsSource = <span style="color:blue;">null</span>;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>datagridTransactions.ItemsSource = ftsTransactionList;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;line-height:normal;margin:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>  </span>datagridTransactions.SelectedIndex = -1;</span></p>
<p class="MsoNormal" style="background:#d9d9d9;margin:0 0 10pt;"><span style="font-size:8pt;line-height:115%;font-family:'Courier New';">}</span></p>
<p>Unlike in ASP.NET, you don&#8217;t call DataBind.  The reason for this may at first just seem like the framework is saving you from writing more code, but the reality is different.  With WPF / Silverlight, the data is not &#8220;binded&#8221; from source to display, so much as it is &#8220;synchronized&#8221;, or &#8220;two-way binded&#8221;.  This means that any changes to the fields of our data control are reflected automatically back to the source object.  For example, one of our FTSTransaction fields is &#8220;Description&#8221;.  If the user edits the &#8220;Description&#8221; field on our datagrid, the &#8220;Description&#8221; field of the respective FTSTransaction object will automatically have changed.</p>
<p><strong>Conclusion</strong></p>
<p>This post introduced the FTS mini-application, a baseline project demonstrating a common line-of-business scenario.  I&#8217;ve highlighted the front-end, which was done in Silverlight 2.0, showing how Silverlight integrates with Windows Communication Foundation for data retrieval and updates.  The next sample featured the Silverlight datagrid, a data-driven control with support for many features, including sorting, and data-templating.</p>
<p>More to come&#8230;</p>
<p>UPDATE: A stand-alone release of this application is now available on my domain:</p>
<p><a href="http://www.bryanpanjavan.net/FTS_Silverlight2/FTS_Silverlight2.html">http://www.bryanpanjavan.net/FTS_Silverlight2/FTS_Silverlight2.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=64&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2009/01/11/financial-transaction-system-a-silverlight-20-line-of-business-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/silverlight_ftstransactions.jpg" medium="image">
			<media:title type="html">Silverlight 2.0 FTS Transactions</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/silverlight_website_wcfwebservice1.jpg" medium="image">
			<media:title type="html">Silverlight 2.0 WebSite WCF Web Service</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2009/01/fts_silverlight_2_classdiagram1.jpg" medium="image">
			<media:title type="html">FTS Silverlight 2.0 Class Diagram</media:title>
		</media:content>
	</item>
		<item>
		<title>School Does Not Teach You How to Fish</title>
		<link>http://bpanjavan.wordpress.com/2009/01/07/school-does-not-teach-you-how-to-fish/</link>
		<comments>http://bpanjavan.wordpress.com/2009/01/07/school-does-not-teach-you-how-to-fish/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 23:53:21 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=61</guid>
		<description><![CDATA[The burden of being an entry level developer is that every time you apply for a job, especially contract jobs, you receive a very skeptical interview from seasoned veteran developers, or moreoften their managers.  The above expression comes to mind.  Your resume doesn&#8217;t say 10+ years DotNet veteran or 5+ years DBA, or 5+ years [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=61&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The burden of being an entry level developer is that every time you apply for a job, especially contract jobs, you receive a very skeptical interview from seasoned veteran developers, or moreoften their managers.  The above expression comes to mind.  Your resume doesn&#8217;t say 10+ years DotNet veteran or 5+ years DBA, or 5+ years Silverlight expert (which is not even possible btw).  What makes it even more futile is that your <a title="MCPD" href="http://www.microsoft.com/learning/mcp/mcts/default.mspx" target="_blank">MCTS</a>/<a title="MCPD" href="http://www.microsoft.com/learning/mcp/mcpd/default.mspx" target="_blank">MCPD</a> doesn&#8217;t seam to mean crap to anyone either&#8230;except recruiters. </p>
<p>It&#8217;s because they always seam to ask the same type of questions.  &#8220;We fish here.  Do you know how to fish?&#8221;  Or maybe &#8220;We fish here using a specific tool.  Have you ever fished using this tool?&#8221;  That Bachelor of Science in Computer Science isn&#8217;t going to save your life either.</p>
<p>I think we can gain a better understanding when we wind the clock back.  Many college grad developers have a degree in computer science.  <a title="Joel Spolsky" href="http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html" target="_blank">Joel Spolsky</a> mentions specifically that curriculums across the country are drastically different.  I was taught in Java in the majority of courses where I actually programmed, and we did nothing more than console applications.  Nothing pretty.  Nothing fancy.  We learned about pointers and recursion.  We learned about simple and complex data types.  We learned about sorting and encryption algorithms.  Is any of this crap useful?  Why didn&#8217;t we just dive into Visual Studio 2005 101 like some other institutions?  If it&#8217;s so easy to drag and drop a Datagrid onto a page and bind it, why didn&#8217;t we just do that?  It&#8217;s not about learning how to fish. </p>
<p>It&#8217;s about learning to find food.  Why? Because the water may dry up in the next 5 years and those who know how to find food will be able to move on to the next hunting ground, while those who only knew how to fish will be lost.  The best institutions teach you how to find food.  Not give you a crash course on how to fish.  I guess it wouldn&#8217;t be so aggravating, but I&#8217;ve seen a lot of middle age folk take a 20 day crash course learning how to drag and drop controls in Visual Studio, and they tend to always win out because they&#8217;re older and get to play the &#8220;seasoned veteran&#8221; card.</p>
<p>It&#8217;s actually nostalgic going back and thinking about it now.  School didn’t teach me how to use Visual Studio 2003/2005/2008, or SQL Management Studio.  Come to think of it, the curriculum didn&#8217;t spoon feed us on how to use the Java compiler (<a title="Eclipse" href="http://www.eclipse.org/" target="_blank">Eclipse</a>) either!  Because why the hell bother?  If a developer has to take a 6 week course to learn every single tool he&#8217;s going to use, he&#8217;d never pick things up fast enough.  And that&#8217;s the point.  I say when you interview a new hire for the long term (meaning more than 3 months), find out if he knows how to find food.</p>
<p>An old colleague of mine, Chris Harper, who was the recruiter at Software Architects, gave me the best interviewee advice for a young developer.  Think of an example in which you picked something up quickly.  Show them how proactive you are.  Unfortunately trying to explain your computer science fundamentals won&#8217;t tell them jack.  The better veteran developers, who know a thing or two about being proactive in this field will get it, and give you the chance you deserve.  The snot-heads will continue to shrug you off because they just went down the list and didn&#8217;t check you off as 10+ years veteran in blah&#8230;the more I read about these people, the more I conclude you wouldn&#8217;t want to work for these companies in the first place.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=61&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2009/01/07/school-does-not-teach-you-how-to-fish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>
	</item>
		<item>
		<title>4 Laws of RIA Usability</title>
		<link>http://bpanjavan.wordpress.com/2008/11/29/4-laws-of-ria-usability/</link>
		<comments>http://bpanjavan.wordpress.com/2008/11/29/4-laws-of-ria-usability/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 04:57:44 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=59</guid>
		<description><![CDATA[As I&#8217;m continuing development with Silverlight, I&#8217;ve been doing some fieldwork, and consider this the fruition of my research so far. #1 No Teleporting The internet is characterized by teleporting from place to place, through hyperlinks.  In the case of the ASP.NET full page post-back, the user teleports to the same place.  An RIA does [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=59&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m continuing development with Silverlight, I&#8217;ve been doing some fieldwork, and consider this the fruition of my research so far. <strong><br />
</strong></p>
<p><strong>#1 No Teleporting</p>
<p></strong>The internet is characterized by teleporting from place to place, through hyperlinks.  In the case of the ASP.NET full page post-back, the user teleports to the same place.  An RIA does not teleport, or &#8220;screen flash&#8221;.  Keep the application to one page, and no post-backs.  This will ensure the ride is smooth and not bumpy.  This is accomplished in Silverlight by default, as your entire application should reside within the Silverlight plugin.</p>
<p><strong>#2 The page is not flat.<br />
</strong><br />
An application that looks flat looks like a newspaper &#8211; something the user reads, but doesn&#8217;t interact with.  Buttons need to not only stand out, but pop out,indicating their clickability.  Use gradient shading to add lighting effects.  Every UI element should be above or below its respective container.  Using gradient shading in XAML is the easiest way to accomplish this in Silverlight.</p>
<p><strong>#3 Don&#8217;t be a magician. </strong></p>
<p>User controls and panels should not just appear and dissapear.  Doing so is too similar to a post-back.  Use transition effects like Powerpoint does to create smooth transitions.  For example, fading in / out, sliding in / out, etc.</p>
<p>XAML storyboard animations get this done.  You can fade something in and out by changing the opacity of a layout control.</p>
<p><strong>#4 A reactive app is not a rich app. </strong></p>
<p>A proactive app is.  The application should be alive and always moving in some way.  Some good examples are having a clock or timer, a stock ticker, or following the mouse coordinates.  Hover effects and tool-tips are a must.</p>
<p>Silverlight can do any of the above examples.</p>
<p>There are several corollaries to the above &#8220;laws&#8221; and I&#8217;ll elaborate in the next posting on this subject.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=59&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2008/11/29/4-laws-of-ria-usability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint Data View Content Preview</title>
		<link>http://bpanjavan.wordpress.com/2008/10/30/sharepoint-data-view-content-preview/</link>
		<comments>http://bpanjavan.wordpress.com/2008/10/30/sharepoint-data-view-content-preview/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 22:40:19 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=50</guid>
		<description><![CDATA[This is from a project I worked on recently with two of my colleagues, Zen Lin and Daryl Leachman. I’m not sure how else to describe this feature / functionality, so I’m calling it the “Data View Content Preview”.  Here’s how it works.  There’s a Data View WebPart on the left side formatted to provide [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=50&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">This is from a project I worked on recently with two of my colleagues, Zen Lin and Daryl Leachman.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">I’m not sure how else to describe this feature / functionality, so I’m calling it the “Data View Content Preview”.<span>  </span>Here’s how it works.<span>  </span>There’s a Data View WebPart on the left side formatted to provide links to the contents of its respective list.<span>  </span>In the middle is the Preview Pane.<span>  </span>When you hover over the items on the Data View WebPart, the Preview Pane (which is really a Content Editor Web Part) shows a preview of the data in the list.</span></p>
<p><a href="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview.jpg"><img class="size-full wp-image-51 alignnone" title="dataviewcontentpreview" src="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview.jpg?w=450&#038;h=157" alt="dataviewcontentpreview" width="450" height="157" /></a></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">NOTE: The links in your Data View WebPart do NOT have to point directly to the items in the list.<span>  </span>Depending on how you format your XSLT, they can point ANYWHERE.<span>  </span>The focus here is establishing the preview functionality.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">First, we start with a custom list:</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"> </p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"> <a href="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreviewemployeelistsettings.jpg"><img class="aligncenter size-full wp-image-55" title="dataviewcontentpreviewemployeelistsettings" src="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreviewemployeelistsettings.jpg?w=450&#038;h=435" alt="" width="450" height="435" /></a></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">This is simply a custom list which contains fields relating to a list of Employees within a company or recruiter database.<span>  </span>The fields vary from single text fields to multi-text fields, to pictures.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">The items I’ve put into the list:</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"> </p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"> <a href="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreviewemployeelistitems.jpg"><img class="aligncenter size-full wp-image-54" title="dataviewcontentpreviewemployeelistitems" src="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreviewemployeelistitems.jpg?w=450&#038;h=154" alt="" width="450" height="154" /></a></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">From this list, we now create a Data View WebPart on our main page.<span>  </span>There are multiple ways to do this, but the way I’m most familiar with is through SharePoint Designer.<span>  </span>Here’s a how-to link:</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><a href="http://office.microsoft.com/en-us/sharepointdesigner/HA100948041033.aspx"><span style="font-size:small;color:#800080;font-family:Calibri;">Create a Data View in SharePoint Designer</span></a></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">Obviously, make sure you use your list as the data source, and be sure and include all parameters.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">Go to the page itself, and modify the WebPart.<span>  </span>Click on the button to edit the XSL:</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"> </p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"> <a href="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview_editxsl.jpg"><img class="aligncenter size-full wp-image-53" title="dataviewcontentpreview_editxsl" src="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview_editxsl.jpg?w=450&#038;h=211" alt="" width="450" height="211" /></a></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">For this particular example, this is what my XSL looked like:</span><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;">&lt;xsl:stylesheet xmlns:x=&#8221;http://www.w3.org/2001/XMLSchema&#8221; xmlns:d=&#8221;http://schemas.microsoft.com/sharepoint/dsp&#8221; version=&#8221;1.0&#8243; exclude-result-prefixes=&#8221;xsl msxsl ddwrt&#8221; xmlns:ddwrt=&#8221;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&#8221; xmlns:asp=&#8221;http://schemas.microsoft.com/ASPNET/20&#8243; xmlns:__designer=&#8221;http://schemas.microsoft.com/WebParts/v2/DataView/designer&#8221; xmlns:xsl=&#8221;http://www.w3.org/1999/XSL/Transform&#8221; xmlns:msxsl=&#8221;urn:schemas-microsoft-com:xslt&#8221; xmlns:SharePoint=&#8221;Microsoft.SharePoint.WebControls&#8221; xmlns:ddwrt2=&#8221;urn:frontpage:internal&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;xsl:output method=&#8221;html&#8221; indent=&#8221;no&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;xsl:decimal-format NaN=&#8221;"/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;xsl:param name=&#8221;dvt_apos&#8221;&gt;&#8217;&lt;/xsl:param&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;xsl:variable name=&#8221;dvt_1_automode&#8221;&gt;0&lt;/xsl:variable&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;xsl:template match=&#8221;/&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;xsl:call-template name=&#8221;dvt_1&#8243;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;/xsl:template&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;xsl:template name=&#8221;dvt_1&#8243;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;xsl:variable name=&#8221;dvt_StyleName&#8221;&gt;Table&lt;/xsl:variable&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;xsl:variable name=&#8221;Rows&#8221; select=&#8221;/dsQueryResponse/Rows/Row&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellpadding=&#8221;2&#8243; cellspacing=&#8221;0&#8243;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;tr valign=&#8221;top&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;xsl:if test=&#8221;$dvt_1_automode = &#8217;1&#8242;&#8221; ddwrt:cf_ignore=&#8221;1&#8243;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>&lt;th class=&#8221;ms-vh&#8221; width=&#8221;1%&#8221; nowrap=&#8221;nowrap&#8221;&gt;&lt;/th&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;/xsl:if&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;th class=&#8221;ms-vh&#8221; nowrap=&#8221;nowrap&#8221;&gt;Full Name&lt;/th&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;xsl:call-template name=&#8221;dvt_1.body&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;xsl:with-param name=&#8221;Rows&#8221; select=&#8221;$Rows&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/xsl:call-template&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;/table&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;/xsl:template&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;xsl:template name=&#8221;dvt_1.body&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;xsl:param name=&#8221;Rows&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;xsl:for-each select=&#8221;$Rows&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                                                </span>&lt;xsl:call-template name=&#8221;dvt_1.rowview&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;/xsl:for-each&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;/xsl:template&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;xsl:template name=&#8221;dvt_1.rowview&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;xsl:if test=&#8221;position() mod 2 = 1&#8243;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;xsl:attribute name=&#8221;class&#8221;&gt;ms-alternating&lt;/xsl:attribute&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/xsl:if&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;xsl:if test=&#8221;$dvt_1_automode = &#8217;1&#8242;&#8221; ddwrt:cf_ignore=&#8221;1&#8243;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;td class=&#8221;ms-vb&#8221; width=&#8221;1%&#8221; nowrap=&#8221;nowrap&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>&lt;span ddwrt:amkeyfield=&#8221;ID&#8221; ddwrt:amkeyvalue=&#8221;ddwrt:EscapeDelims(string(@ID))&#8221; ddwrt:ammode=&#8221;view&#8221;&gt;&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/xsl:if&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span><span style="background:yellow;">&lt;td class=&#8221;ms-vb&#8221; style=&#8221;width:100%;vertical-align:middle;border:solid 1px gray; &#8221; </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>onmousemove=&#8221;javascript:return OpenDataPreviewPane(this);&#8221;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>onmouseout=&#8221;javascript:return CloseDataPreviewPane(this);&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>&lt;a href=&#8221;http://litwareserver/Lists/DataViewContentPreviewEmployeeList/DispForm.aspx?ID={@ID}&#8221;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>   </span>style=&#8221;width:100%; height:30px; vertical-align:middle;&#8221;&gt;&lt;xsl:value-of select=&#8221;@Title&#8221;/&gt;&lt;/a&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;span id=&#8221;spanDataViewFullName&#8221; style=&#8221;display:none;&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span><span>                     </span>&lt;xsl:value-of select=&#8221;@Title&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;span id=&#8221;spanDataViewDescription&#8221; style=&#8221;display:none;&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span><span>                     </span>&lt;xsl:value-of select=&#8221;@Description&#8221; disable-output-escaping=&#8221;yes&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;span id=&#8221;spanDataViewEmployeePhoto&#8221; style=&#8221;display:none;&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span><span>                     </span>&lt;img border=&#8221;0&#8243; src=&#8221;{substring-before(@PhotoID, &#8216;, &#8216;)}&#8221; alt=&#8221;{substring-after(@PhotoID, &#8216;, &#8216;)}&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;span id=&#8221;spanDataViewExperience&#8221; style=&#8221;display:none;&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span><span>                     </span>&lt;xsl:value-of select=&#8221;@Experience&#8221; disable-output-escaping=&#8221;yes&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;span id=&#8221;spanDataViewLinks&#8221; style=&#8221;display:none;&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span><span>                     </span>&lt;xsl:value-of select=&#8221;@Links&#8221; disable-output-escaping=&#8221;yes&#8221;/&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span><span>  </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Calibri;"><span style="font-size:8pt;background:yellow;color:#1f497d;line-height:115%;"><span>                                                                        </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;/tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;/xsl:template&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;">&lt;/xsl:stylesheet&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;line-height:115%;"><span style="font-family:Calibri;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">I highlighted the most important part, the part that actually displays.<span>  </span>In this table cell, what is displayed for each list item is the Full Name field in a hyper link, pointing toward the list item edit page itself.<span>  </span>REMEMBER, this does not have to point to the list item itself.<span>  </span>It can point anywhere.<span>  </span>In this same cell is a series of HTML &lt;span&gt; elements, all containing the remaining values as if they are to be displayed.<span>  </span>But these are purposely hidden using the CSS style DISPLAY property.<span>  </span>These are here for a reason.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">So now we have our Data View WebPart on our page:</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;font-family:Calibri;"> <a href="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview_dataviewwebpart.jpg"><img class="aligncenter size-full wp-image-52" title="dataviewcontentpreview_dataviewwebpart" src="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview_dataviewwebpart.jpg?w=360&#038;h=273" alt="" width="360" height="273" /></a></span></span><span style="font-size:8pt;line-height:115%;"><span style="font-family:Calibri;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">Now add a Content Editor WebPart to the middle zone of the page.<span>  </span>Here’s the source:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;">&lt;script type=&#8221;text/javascript&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;!&#8211;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>function GetSpanById(listSpans, strID)</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>{</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>for (var intCounter = 0; intCounter &lt; listSpans.length; intCounter++)</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>{</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>if (listSpans[intCounter].id == strID)</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>return listSpans[intCounter];</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>}</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>return null;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>}</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>function OpenDataPreviewPane(sender)</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>{</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var tdParent = sender;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>tdParent.className = &#8220;ms-itemhover&#8221;;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var listSpans = tdParent.getElementsByTagName(&#8220;span&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanDataViewFullName= GetSpanById(listSpans, &#8220;spanDataViewFullName&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanDataViewDescription= GetSpanById(listSpans, &#8220;spanDataViewDescription&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanDataViewEmployeePhoto= GetSpanById(listSpans, &#8220;spanDataViewEmployeePhoto&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanDataViewExperience= GetSpanById(listSpans, &#8220;spanDataViewExperience&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanDataViewLinks= GetSpanById(listSpans, &#8220;spanDataViewLinks&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var tablePreviewPane = document.getElementById(&#8220;tablePreviewPane&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>tablePreviewPane.style.display = &#8220;block&#8221;;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanPreviewPaneFullName = document.getElementById(&#8220;spanPreviewPaneFullName&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>spanPreviewPaneFullName.innerHTML = spanDataViewFullName.innerHTML;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanPreviewPaneDescription= document.getElementById(&#8220;spanPreviewPaneDescription&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>spanPreviewPaneDescription.innerHTML = spanDataViewDescription.innerHTML;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanPreviewPaneEmployeePhoto= document.getElementById(&#8220;spanPreviewPaneEmployeePhoto&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>spanPreviewPaneEmployeePhoto.innerHTML = spanDataViewEmployeePhoto.innerHTML;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanPreviewPaneExperience= document.getElementById(&#8220;spanPreviewPaneExperience&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>spanPreviewPaneExperience.innerHTML = spanDataViewExperience.innerHTML;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var spanPreviewPaneLinks= document.getElementById(&#8220;spanPreviewPaneLinks&#8221;);</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>spanPreviewPaneLinks.innerHTML = spanDataViewLinks.innerHTML;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>return false;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>}</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>function CloseDataPreviewPane(sender)</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>{</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>var tdParent = sender;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>tdParent.className = &#8220;ms-vb&#8221;;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>return false;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>}</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>//&#8211;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;/script&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;table id=&#8221;tablePreviewPane&#8221; class=&#8221;ms-vb&#8221; style=&#8221;display:none;&#8221; cellspacing=&#8221;0&#8243;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;td colspan=&#8221;2&#8243; &gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;span id=&#8221;spanPreviewPaneFullName&#8221; style=&#8221;width:100%; font-size:large; text-align:center;&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;/tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;td colspan=&#8221;2&#8243;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;span style=&#8221;text-decoration:underline;&#8221;&gt;Description&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;span id=&#8221;spanPreviewPaneDescription&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;/tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;td style=&#8221;width:25%;&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;span id=&#8221;spanPreviewPaneEmployeePhoto&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;table style=&#8221;width:100%;&#8221; class=&#8221;ms-vb&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>&lt;tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;span style=&#8221;text-decoration:underline;&#8221;&gt;Experience&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;span id=&#8221;spanPreviewPaneExperience&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>&lt;/tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>&lt;tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;span style=&#8221;text-decoration:underline;&#8221;&gt;Links&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;span id=&#8221;spanPreviewPaneLinks&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                                        </span>&lt;/span&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                                                </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                                        </span>&lt;/tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                                                </span>&lt;/table&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                                        </span>&lt;/td&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                                                </span>&lt;/tr&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                        </span>&lt;/table&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:8pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"> </span></span><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">It’s a little heavy.<span>  </span>So let’s break down what’s going on.<span>  </span>First we’ll focus on the main table that’s displaying the data.<span>  </span>This &lt;table&gt; element, with an id of “tablePreviewPane” holds our preview data.<span>  </span>Essentially its intention is to display the preview data in this format:</span></p>
<p><span style="font-size:11pt;line-height:115%;font-family:&quot;"><br />
</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<table class="MsoNormalTable" style="border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width:6.65in;background-color:transparent;border:black 1pt solid;padding:0 5.4pt;" colspan="2" width="638" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:small;font-family:Calibri;">&lt;Full Name&gt;</span></p>
</td>
</tr>
<tr>
<td style="border-right:black 1pt solid;border-top:#d4d0c8;border-left:black 1pt solid;width:6.65in;border-bottom:black 1pt solid;background-color:transparent;padding:0 5.4pt;" colspan="2" width="638" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="text-decoration:underline;"><span style="font-size:small;"><span style="font-family:Calibri;">Description</span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">&lt;Description&gt;</span></p>
</td>
</tr>
<tr style="height:7.9pt;">
<td style="border-right:black 1pt solid;border-top:#d4d0c8;border-left:black 1pt solid;width:126.9pt;border-bottom:black 1pt solid;height:7.9pt;background-color:transparent;padding:0 5.4pt;" rowspan="2" width="169" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">&lt;Employee Photo&gt;</span></p>
</td>
<td style="border-right:black 1pt solid;border-top:#d4d0c8;border-left:#d4d0c8;width:351.9pt;border-bottom:black 1pt solid;height:7.9pt;background-color:transparent;padding:0 5.4pt;" width="469" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="text-decoration:underline;"><span style="font-size:small;"><span style="font-family:Calibri;">Experience</span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">&lt;Experience&gt;</span></p>
</td>
</tr>
<tr style="height:7.85pt;">
<td style="border-right:black 1pt solid;border-top:#d4d0c8;border-left:#d4d0c8;width:351.9pt;border-bottom:black 1pt solid;height:7.85pt;background-color:transparent;padding:0 5.4pt;" width="469" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">Links</span></p>
<p class="MsoNormal" style="margin:0;"><span style="text-decoration:underline;"><span style="font-size:small;"><span style="font-family:Calibri;">Links</span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">&lt;Links&gt;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">Our main JavaScript function, “OpenDataPreviewPane” takes in the table cell element as its sender.<span>  </span>Remember this particular section in our XSL markup:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;">&lt;td class=&#8221;ms-vb&#8221; style=&#8221;width:100%;vertical-align:middle;border:solid 1px gray; &#8221; </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                </span>onmousemove=&#8221;javascript:return OpenDataPreviewPane(this);&#8221;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#1f497d;line-height:115%;"><span style="font-family:Calibri;"><span>                </span>onmouseout=&#8221;javascript:return CloseDataPreviewPane(this);&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">The “onmousemove” event calls the “OpenDataPreviewPane” function, passing itself as the sender.<span>  </span>The “OpenDataPreviewPane” uses the sender argument to traverse the hidden &lt;span&gt; elements that we left hidden earlier.<span>  </span>One by one, the contents of those elements are grabbed and set to the respective places in the Preview Pane, and the sender, which is the table cell, is highlighted.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">NOTE: For aesthetics, I set my left WebPart zone to a width of 25%, and my middle WebPart zone to a width of 50%. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">A couple of questions may arise regarding this implementation:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">Q: Why didn’t you just use web part connections?</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">A: We want something not only simple in terms of MOSS features, but RICH.<span>  </span>Dropping Content Editor WebParts onto pages is very simple.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">Q: Why didn’t you just pass in those parameters as arguments to the JavaScript function?</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">A: Trying to parse and deal with special characters (ex: single quote) was a nightmare.<span>  </span>This is the entire reason we came up with the “traverse the &lt;span&gt;’s” solution instead.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">Q: What happens if I change the theme?<span>  </span>Will the color scheme be off?</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">A: Try it.<span>  </span>The HTML within the Content Editor part uses SharePoint CSS classes so this shouldn’t be a problem</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=50&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2008/10/30/sharepoint-data-view-content-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview.jpg" medium="image">
			<media:title type="html">dataviewcontentpreview</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreviewemployeelistsettings.jpg" medium="image">
			<media:title type="html">dataviewcontentpreviewemployeelistsettings</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreviewemployeelistitems.jpg" medium="image">
			<media:title type="html">dataviewcontentpreviewemployeelistitems</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview_editxsl.jpg" medium="image">
			<media:title type="html">dataviewcontentpreview_editxsl</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/10/dataviewcontentpreview_dataviewwebpart.jpg" medium="image">
			<media:title type="html">dataviewcontentpreview_dataviewwebpart</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint: Enabling Forms Authentication</title>
		<link>http://bpanjavan.wordpress.com/2008/09/20/sharepoint-enabling-forms-authentication/</link>
		<comments>http://bpanjavan.wordpress.com/2008/09/20/sharepoint-enabling-forms-authentication/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 05:35:34 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=28</guid>
		<description><![CDATA[  Problem: SharePoint 2003 could only use Windows Authentication, which made it an ideal portal solution for the corporate intranet.  Not the Internet.  But now thanks to the foundation of ASP.NET 2.0, SharePoint 2007 can use Forms Authentication, aptly described as “pluggable” authentication.  Easier said than done. Background:  First, a little re-cap on authentication vs. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=28&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"><strong></strong></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"><strong></strong></span> </p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"><strong>Problem</strong>: SharePoint 2003 could only use Windows Authentication, which made it an ideal portal solution for the corporate intranet.<span>  </span>Not the Internet.<span>  </span>But now thanks to the foundation of ASP.NET 2.0, SharePoint 2007 can use Forms Authentication, aptly described as “pluggable” authentication.<span>  </span>Easier said than done.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"><strong>Background</strong>:<span>  </span>First, a little re-cap on authentication vs. authorization.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;"><span style="font-family:Calibri;"><em>Authentication &#8211; </em>Identifying users.<span>  </span>A user is authenticated if they are recognized, most commonly by their active directory account (Windows) or within a website’s database (Forms).<span>  </span>As long as there exists an authentication provider, a user can be authenticated.<span>  </span><span> </span></span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"><em>Authorization &#8211; </em>Specifies what a user is allowed to do.<span>  </span>In other words, what a user is authorized to do.<span>  </span>This can be based on the user’s role (ex: Visitor, Member, Admin), or even configured by their user name.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"><strong>Solution</strong>:<span>  </span>By default, a SharePoint 2007 site collection is configured to use Windows Authentication.<span>  </span>To be more precise, a web site hosting a SharePoint site collection is configured for Windows Authentication.<span>  </span>All site collections under a web site will use the same authentication provider.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;"><strong>1. Create a new web site (a.k.a. web application) that will be configured for Forms Authentication</strong></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">a. Open SharePoint Central Administration.<span>  </span>Click on the <strong>Application Management Tab</strong>.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">b. Under <strong>SharePoint Web Application Managerment</strong>, click <em>Create or Extend Web Application</em>.  Click <em>Create a New Web Application</em>.</span></p>
<p class="MsoNormal"><span style="font-family:Calibri;"><span style="font-size:small;">c. <span style="font-size:small;">Ensure that <em>Create a new IIS Web Site</em> is selected.<span>  </span>In the <strong>Application Pool</strong> section, under “Select a security account for the application pool”, select Configurable and choose a User Name and Password.<span>  </span>I recommend using the same as your SharePoint Administrator.<span>  </span>In the Search Server section, choose an appropriate Search Server.<span>  </span>Click OK.</span></span></span></p>
<div id="attachment_33" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2008/09/createnewwebsite.jpg"><img class="size-large wp-image-33" title="Create New Web Site" src="http://bpanjavan.files.wordpress.com/2008/09/createnewwebsite.jpg?w=450&#038;h=341" alt="Create New Web Site" width="450" height="341" /></a><p class="wp-caption-text">Create New Web Site</p></div>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;"><strong>2. Create a new site collection under the newly created web site</strong></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">a. If you’re coming straight from the previous step, you can click on the <em>Create Site Collection</em> link to go straight to the creation page.<span>  </span>Otherwise, you can navigate from the <strong>Application Management</strong> tab and under <strong>SharePoint Site Management</strong>, click on <em>Create Site Collection.</em></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">b. Ensure that the web application selected at the top of the form is the same that you just created.<span>  </span>Type an appropriate Title and Description.<span>  </span>Choose a template in the Template Selection section.<span>  </span>I recommend <em>Team Site</em> or <em>Blank Site</em>.<span>  </span>Type in the user name in the <strong>Primary Site Collection Administrator</strong> section.<span>  </span>This won’t matter later because we’ll have to choose another one after switching to Forms Authentication, but for now we need one.<span>  </span>Click OK.</span></p>
<div id="attachment_35" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2008/09/createsitecollection.jpg"><img class="size-large wp-image-35" title="Create Site Collection" src="http://bpanjavan.files.wordpress.com/2008/09/createsitecollection.jpg?w=450&#038;h=342" alt="Create Site Collection" width="450" height="342" /></a><p class="wp-caption-text">Create Site Collection</p></div>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;"><strong>3. Create a new provider for Forms Authentication</strong></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">a. Now that we have created our new web site and site collection, we’re ready to start configuring forms authentication.<span>  </span>First we need a provider to host the forms authenticated users.<span>  </span>This is the provider we’re going to switch to.</span></p>
<p class="MsoNormal"><span style="font-family:Calibri;"><span style="font-size:small;">b. <span style="font-size:small;">Locate a folder where you can access the program aspnet_regsql.exe through the command prompt.<span>  </span>You can also click on:<span>  </span></span></span></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;"><em>Start -&gt; All Programs -&gt; Visual Studio 2005/2008 -&gt; Visual Studio Tools -&gt; Visual Studio 2005/2008 Command Prompt</em></span></p>
<p class="MsoNormal"><span style="font-size:small;"><em><span style="font-family:Calibri;">c. </span></em><span style="font-size:small;"><span style="font-family:Calibri;">Execute the command: <em>aspnet_regsql –E –A all –S DatabaseServerName</em><span>  </span></span></span></span></p>
<p class="MsoNormal"><span style="font-size:small;"><span style="font-size:small;"><span style="font-family:Calibri;"><span>d. </span></span></span></span><span style="font-size:small;font-family:Calibri;">This command creates the new database that will act as your provider.<span>  </span>The –E authenticates with your account to execute the command, the –A specifies that you’re adding support for features, and ‘all’ specifies to include all features, including authentication.<span>  </span>Finally, the –S specifies your database server name.</span></p>
<p class="MsoNormal"><span style="font-family:Calibri;"><span style="font-size:small;">e. <span style="font-size:small;">You can verify this by checking on your database server for the newly created database: <strong>aspnetdb</strong>.</span></span></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;"><strong>4. Configure your provider under your web site</strong></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">a. Open your web site in Visual Studio 2005 / 2008.<span>  </span>You can NOT open it up through IIS, so open it up through the file system.<span>  </span>To do so, Open Visual Studio 2005 / 2008 and choose <em>File -&gt; Open -&gt; Web Site</em></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">b. Choose File System on the left, and navigate to the folder of your web site.<span>  </span>This should be under <em>c:\inetpub\wwwroot\wss\Virtual Directories\&lt;&lt;your web site folder&gt;&gt;</em>.<span>  </span>Click Open.<span>  </span>If you’re using Visual Studio 2008, you’ll get the prompt to upgrade the site to .NET 3.5.<span>  </span>Please say NO.</span></p>
<div id="attachment_36" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2008/09/openwebsite.jpg"><img class="size-large wp-image-36" title="Open Web Site" src="http://bpanjavan.files.wordpress.com/2008/09/openwebsite.jpg?w=450&#038;h=352" alt="Open Web Site" width="450" height="352" /></a><p class="wp-caption-text">Open Web Site</p></div>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">c. In order for an ASP.NET site to connect to a SQL Server database, it needs a connection string.<span>  </span>Add a &lt;connectionString&gt; element to your web.config file as a child element of the root &lt;configuration&gt; element:</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">&lt;connectionStrings&gt;<br />
    &lt;remove name=&#8221;AspNetSqlProvider&#8221; /&gt;<br />
    &lt;add name=&#8221;AspNetSqlProvider&#8221; connectionString=&#8221;Data Source=LITWARESERVER\;Initial Catalog=aspnetdb;Persist Security Info=True;User ID=sa;Password=*****&#8221; providerName=&#8221;System.Data.SqlClient&#8221; /&gt;<br />
  &lt;/connectionStrings&gt;</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">d. Add the &lt;membership&gt; element as a child of the &lt;system.web&gt; element.<span>  </span>This element contains the &lt;providers&gt; element, which will contain our new provider.<span>  </span>Our provider will point toward our database through the connectionStringName attribute.<span>  </span>Set the defaultProvider attribute value to our provider, in this case: <em>AspNetSqlMembershipProvider</em></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">&lt;membership defaultProvider=&#8221;AspNetSqlMembershipProvider&#8221;&gt;<br />
      &lt;providers&gt;<br />
        &lt;remove name=&#8221;AspNetSqlMembershipProvider&#8221; /&gt;<br />
        &lt;add name=&#8221;AspNetSqlMembershipProvider&#8221; connectionStringName=&#8221;AspNetSqlProvider&#8221; passwordAttemptWindow=&#8221;10&#8243; enablePasswordRetrieval=&#8221;false&#8221; enablePasswordReset=&#8221;true&#8221; requiresQuestionAndAnswer=&#8221;true&#8221; applicationName=&#8221;/&#8221; requiresUniqueEmail=&#8221;false&#8221; passwordFormat=&#8221;Hashed&#8221; type=&#8221;System.Web.Security.SqlMembershipProvider, System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&#8221; /&gt;<br />
      &lt;/providers&gt;<br />
    &lt;/membership&gt;</span></p>
<p class="MsoNormal"><span style="font-family:Calibri;"><span style="font-size:small;">e. <span style="font-size:small;">Add the &lt;roleManager&gt; element immediately under the &lt;membership&gt; element.<span>  </span>This element also contains child elements to specify the provider.<span>  </span>In the &lt;roleManager&gt; element, set the enabled attribute value to “true”, and the defaultProvider attribute value to our role provider, in this case: <em>AspNetSqlRoleProvider</em>.</span></span></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">&lt;roleManager enabled=&#8221;true&#8221; defaultProvider=&#8221;AspNetSqlRoleProvider&#8221;&gt;<br />
    &lt;providers&gt;<br />
     &lt;remove name=&#8221;AspNetSqlRoleProvider&#8221; /&gt;<br />
     &lt;add name=&#8221;AspNetSqlRoleProvider&#8221; connectionStringName=&#8221;AspNetSqlProvider&#8221; applicationName=&#8221;/&#8221; type=&#8221;System.Web.Security.SqlRoleProvider, System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&#8221; /&gt;<br />
    &lt;/providers&gt;<br />
   &lt;/roleManager&gt;</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">f. Your <strong>Central Administration</strong> site must ALSO be aware of your new provider.<span>  </span>So add the &lt;connectionString&gt; element the &lt;membership&gt; element, and the &lt;roleManager&gt; element to the web.config of your <strong>Central Administration</strong> site as well.<span>  </span>However, REMOVE the defaultProvider attributes of the &lt;membership&gt; and &lt;roleManager&gt; elements, and remove the enabled attribute of the &lt;roleManager&gt; element.<span>  </span>BE CAREFUL.<span>  </span>Make sure you open the web.config of you central administration site, and not your first SharePoint site (likely to be under port 80). </span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">5. Switch to your new provider and add users to the database</span></p>
<p class="MsoNormal"><span style="font-size:small;"><span style="font-family:Calibri;">a. Now it’s time to make the switch.<span>  </span>Open the <strong>ASP.NET Configuration Tool</strong> under Website -&gt; ASP.NET Configuration (look for the icon that looks like the earth and a piece of dynamite next to it).<span>  </span></span></span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">b. Under the <strong>Security</strong> tab, under the <strong>Users</strong> section, click on Select authentication type.<span>  </span>Select “From the Internet”.<span>  </span>This effectively switches the authentication mode to “Forms”.<span>  </span>Click Done.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">c. Now within the same section, click on <em>Create User</em> and follow the steps to create a new user.<span>  </span>I recommend creating at least two.<span>  </span>One of them will be your new Administrator for your SharePoint site.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">d. Also use the site configuration tool to add at least one role, and make sure any user you added is place under a role.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">e. Exit the configuration tool by closing the browser containing it.<span>  </span>You’ll be prompted with a message indicating that the web.config file has changed.<span>  </span>This is because you changed the authentication type.<span>  </span>Click “Yes” to continue.<span>  </span>You can confirm your change by finding the &lt;authentication&gt; element and the mode attribute value should now be “Forms”.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">6. Switch your authentication provider and add the new administrator</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">a. It’s almost over.<span>  </span>Go to <strong>SharePoint Central Administration</strong> and go to <em>Authentication</em> providers under <strong>Application Security</strong>.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">b. Your web site (upper right) should be the same one we’ve been working on this whole freakin’ time.<span>  </span>If not, change it.<span>  </span>Under Zone, click <em>Default</em>.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">c. In the <strong>Authentication Type</strong> section, select Forms.<span>  </span>You can choose to enable anonymous access at your discretion.<span>  </span>In the <strong>Membership Provider Name</strong> section, enter the same membership provider we configured, which in this example is <em>AspNetSqlMembershipProvider</em>.<span>  </span>Click Save.</span></p>
<div id="attachment_38" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2008/09/switchsharepointauthenticationprovider.jpg"><img class="size-large wp-image-38" title="Switch SharePoint Provider" src="http://bpanjavan.files.wordpress.com/2008/09/switchsharepointauthenticationprovider.jpg?w=450&#038;h=350" alt="Switch SharePoint Provider" width="450" height="350" /></a><p class="wp-caption-text">Switch SharePoint Provider</p></div>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">d. Finally, return to <strong>Application Management</strong> under <strong>Central Administration</strong>, and under <strong>SharePoint Site Management</strong>, click <em>Site collection administrators</em>.</span></p>
<p class="MsoNormal"><span style="font-size:small;"><span style="font-family:Calibri;"><span>e. </span>Once again, your web site (upper right) should be the same one we’ve been working on.<span>  </span>In the <strong>Primary Site Collection Administrator</strong> section, enter one of the user names you created in step 5c.<span>  </span>Click on the Check Names icon to the right to verify this user name is valid.<span>  </span></span></span></p>
<p class="MsoNormal" style="text-indent:-1.5in;margin:0 0 10pt 1.5in;"><span style="font-size:small;font-family:Calibri;"><span style="font-family:Times New Roman;">        i. </span><strong>WARNING</strong>:<span>  </span>Many people have had problems at this step.<span>  </span>The message “No exact match was found” appears for the user name they entered.<span>  </span>This could mean that you did not add the &lt;connectionStrings&gt; element and &lt;membership&gt; element to BOTH this web site AND the <strong>Central Administration</strong>web site, or that you made a typo when configuring your web.config.<span>  </span>Verify from step 4 that you proceeded correctly.</span></p>
<div id="attachment_37" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2008/09/addnewsiteadministrator.jpg"><img class="size-large wp-image-37" title="Add New Site Administrator" src="http://bpanjavan.files.wordpress.com/2008/09/addnewsiteadministrator.jpg?w=450&#038;h=326" alt="Add New Site Administrator" width="450" height="326" /></a><p class="wp-caption-text">Add New Site Administrator</p></div>
<p>f. <span style="font-size:small;font-family:Calibri;">Click OK.</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">7. Log in</span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Calibri;">a. Finally, go to your site collection and log in as your administrator.<span>  </span>If you cannot log in, return to step 4 and verify that you proceeded correctly. </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=28&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2008/09/20/sharepoint-enabling-forms-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/09/createnewwebsite.jpg?w=450" medium="image">
			<media:title type="html">Create New Web Site</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/09/createsitecollection.jpg?w=450" medium="image">
			<media:title type="html">Create Site Collection</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/09/openwebsite.jpg?w=450" medium="image">
			<media:title type="html">Open Web Site</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/09/switchsharepointauthenticationprovider.jpg?w=450" medium="image">
			<media:title type="html">Switch SharePoint Provider</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/09/addnewsiteadministrator.jpg?w=450" medium="image">
			<media:title type="html">Add New Site Administrator</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint: Change the Title Bar Background for a Single Web Part</title>
		<link>http://bpanjavan.wordpress.com/2008/08/27/sharepoint-change-the-title-bar-background-for-a-single-web-part/</link>
		<comments>http://bpanjavan.wordpress.com/2008/08/27/sharepoint-change-the-title-bar-background-for-a-single-web-part/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 03:52:21 +0000</pubDate>
		<dc:creator>bpanjavan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://bpanjavan.wordpress.com/?p=15</guid>
		<description><![CDATA[Premise: A co-worker of mine asked me a very simple question about SharePoint look-and-feel:  “Do you know how to change the title bar background for a single web part? (Say..just the Announcement web part alone)”  A SharePoint developer sometimes cringes at this type of question.  It’s such a simple request.  The client probably expects a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=15&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"><strong>Premise</strong>: A co-worker of mine asked me a very simple question about SharePoint look-and-feel: </span></span></span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 0 .5in;"><em><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">“</span><span><span style="font-size:small;"><span style="font-family:Calibri;">Do you know how to change the title bar background for a single web part? (Say..just the Announcement web part alone)”</span></span></span></em></p>
<p><span><span style="font-size:small;font-family:Calibri;"> </span></span><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">A SharePoint developer sometimes cringes at this type of question.<span>  </span>It’s such a simple request.<span>  </span>The client probably expects a very simple solution.<span>  </span>Let’s make some simple assumptions:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"><strong>This will appear for that ONE web part, no matter what page it’s on.</strong><span>  </span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">For example, if I want the background of my Announcements web part to be green on the default page, I want the background of my Announcements web part page to be green on some other site page that it’s added to.</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"><strong>My client thinks this is easy, so it had better be.</strong></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><strong></strong> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">Don’t spend time with some crazy outlandish under-the-box solution, like a custom web part, that you would have to re-deploy sometime later…Let’s think of something that is simple, takes little to no amount of work, and is also flexible (can be applied to potentially other web parts in the future).</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"><strong>Solution</strong>:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">Let’s look at what we’ve got.<span>  </span><span> </span></span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">All web part headers use the Css class: </span><em><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">ms-WPHeader</span></em><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;"> from the Theme.css file under their respective theme.<span>  </span>Perhaps you could do a custom theme, and change the background color of the ms-WPHeader class.<span>  </span>However, this will change the background color of ALL web parts, not just the one.<span>  </span>Plus, you’d have to create a custom theme (though the client will probably need one eventually anyway).</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">If you put an announcement web part on to a page, you can look at the HTML source and find the &lt;td&gt; element for it:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:Arial,sans-serif;">&lt;td title=&#8221;Announcements &#8211; Use the Announcements list to post messages on the home page of your site.&#8221; id=&#8221;WebPartTitleWPQ1&#8243; style=&#8221;width:100%;&#8221;&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">You can fixate on that td element with JavaScript and change the background color.  If you want this to happen on every page that has an announcement web part, you place this in the Master Page (default.master).  The master page is under the 12 hive path:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><em></em></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><em><span style="font-size:10pt;font-family:Arial,sans-serif;">C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL</span></em></p>
<div></div>
<div><span style="font-size:12pt;font-family:'Times New Roman',serif;"></span></div>
<p><span style="font-size:12pt;font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"></p>
<div class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2008/08/masterpage_javascript1.png"><img class="size-full wp-image-17" src="http://bpanjavan.files.wordpress.com/2008/08/masterpage_javascript1.png?w=450&#038;h=142" alt="MasterPage JavaScript" width="450" height="142" /></a><p class="wp-caption-text">MasterPage JavaScript</p></div>
<p><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"> </span></span></span></span></p>
<p><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"> </p>
<p></font></font></font></font></span></span><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"> </p>
<p></font></font></font></span></span><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"> </p>
<p></font></font></span></span><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"> </p>
<p></font></span></span> </p>
<p></span></span><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"> </span></span></span></p>
<p><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"> </p>
<p></font></font></font></span></span><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"> </p>
<p></font></font></span></span><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"> </p>
<p></font></span></span> </p>
<p></span></span><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"> </span></span></p>
<p><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"><font face="'Times New Roman','serif'"> </p>
<p></font></font></span></span><span style="font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"> </p>
<p></font></span></span> </p>
<p></span></span><span style="font-family:'Times New Roman',serif;"> </span></p>
<p><span style="font-size:12pt;font-family:'Times New Roman',serif;"><span style="font-family:'Times New Roman',serif;"><span style="font-size:12pt;font-family:'Times New Roman',serif;"><font face="'Times New Roman','serif'"> </p>
<p></font></span></span> </p>
<p></span></span></p>
<p><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">Bingo.  It&#8217;s a banged up solution but it gets the job done quickly and without compiling any code.<span>  </span>The unfortunate thing is that this is technically in-the-box because it required a developer to change the Master Page.</span></p>
<div id="attachment_21" class="wp-caption aligncenter" style="width: 460px"><a href="http://bpanjavan.files.wordpress.com/2008/08/result_background.png"><img class="size-full wp-image-21" src="http://bpanjavan.files.wordpress.com/2008/08/result_background.png?w=450&#038;h=248" alt="Result" width="450" height="248" /></a><p class="wp-caption-text">Result</p></div>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">But when we say ONLY ONE web part, it could be just one web part on a single page.  On that note, what you can do is take the same JavaScript and put that into a content editor web part on the same page as your announcements web part.</span></p>
<div id="attachment_20" class="wp-caption alignnone" style="width: 310px"><a href="http://bpanjavan.files.wordpress.com/2008/08/usingcontenteditorwebpart.png"><img class="size-medium wp-image-20" src="http://bpanjavan.files.wordpress.com/2008/08/usingcontenteditorwebpart.png?w=300&#038;h=161" alt="Using Content Editor Web Part" width="300" height="161" /></a><p class="wp-caption-text">Using Content Editor Web Part</p></div>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;color:#000000;font-family:Arial,sans-serif;">If you use the content editor web part, make sure you:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"> </p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;font-family:Arial,sans-serif;">- Put the content editor web part BELOW your announcement web part, to make sure that the JavaScript executes AFTER the announcement web part loads</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;font-family:Arial,sans-serif;">- Clear out the title and border style of the content editor web part so it doesn&#8217;t show up to users.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:12pt;color:#000000;line-height:115%;font-family:'Times New Roman',serif;">- For this reason I consider the Content Editor web part to be an incredibly powerful web part.<span>  </span>The client may not understand the HTML gibberish that you as a developer put into it, but they get to make the decision whether to keep it on their page or not.<span>  </span>Powerful.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bpanjavan.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bpanjavan.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bpanjavan.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bpanjavan.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bpanjavan.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bpanjavan.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bpanjavan.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bpanjavan.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bpanjavan.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bpanjavan.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bpanjavan.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bpanjavan.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bpanjavan.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bpanjavan.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bpanjavan.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bpanjavan.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bpanjavan.wordpress.com&amp;blog=2336439&amp;post=15&amp;subd=bpanjavan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bpanjavan.wordpress.com/2008/08/27/sharepoint-change-the-title-bar-background-for-a-single-web-part/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a15422a029777aef5f659701450993?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bryan</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/08/masterpage_javascript1.png" medium="image">
			<media:title type="html">MasterPage JavaScript</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/08/result_background.png" medium="image">
			<media:title type="html">Result</media:title>
		</media:content>

		<media:content url="http://bpanjavan.files.wordpress.com/2008/08/usingcontenteditorwebpart.png?w=300" medium="image">
			<media:title type="html">Using Content Editor Web Part</media:title>
		</media:content>
	</item>
	</channel>
</rss>
