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

<channel>
	<title>Dev Team Assemble &#187; Uncategorized</title>
	<atom:link href="http://www.calvinirwin.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.calvinirwin.net</link>
	<description>Evil beware!</description>
	<lastBuildDate>Wed, 28 Jul 2010 12:55:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SharePoint Web Part Maintenance Mode</title>
		<link>http://www.calvinirwin.net/2010/02/02/sharepoint-web-part-maintenance-mode/</link>
		<comments>http://www.calvinirwin.net/2010/02/02/sharepoint-web-part-maintenance-mode/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 19:48:17 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[webparts sharepoint development]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/2010/02/02/sharepoint-web-part-maintenance-mode/</guid>
		<description><![CDATA[Here is something I always forget....when a page fails to load because of a web part that has gone awry you can enter the maintenance mode by adding the ?contents=1 to the end of the address.
Simple...just the way I like it!



Technorati Tags: webparts sharepoint development


]]></description>
			<content:encoded><![CDATA[<p>Here is something I always forget....when a page fails to load because of a web part that has gone awry you can enter the maintenance mode by adding the ?contents=1 to the end of the address.</p>
<p>Simple...just the way I like it!</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/webparts+sharepoint+development' rel='tag' target='_self'>webparts sharepoint development</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2010/02/02/sharepoint-web-part-maintenance-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint Conference SPC09 Day 1 Review</title>
		<link>http://www.calvinirwin.net/2009/10/20/sharepoint-conference-spc09-day-1-review/</link>
		<comments>http://www.calvinirwin.net/2009/10/20/sharepoint-conference-spc09-day-1-review/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 16:25:55 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SPC09]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=215</guid>
		<description><![CDATA[Yesterday started with a hangover...for me.  On Sunday there was a SharePint event at the Eye Candy bar in the middle of Mandalay Bay and I was one of the  unfortunate souls whohappened to have drank too much    The Keynotes were pretty cool...nothing overly stand out there was a lot of talk about [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday started with a hangover...for me.  On Sunday there was a SharePint event at the Eye Candy bar in the middle of Mandalay Bay and I was one of the  unfortunate souls whohappened to have drank too much <img src='http://www.calvinirwin.net/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' />   The Keynotes were pretty cool...nothing overly stand out there was a lot of talk about the new product and moving forward and a couple of demos that probably were a little too long.  Truth be told my butt hurt from sitting through almost 3 hours of Keynotes so I was happy when it was done.</p>
<p>In the afternoon the actual session began.  for me it was the <strong>Whats New For Developer Overview</strong>, <strong>Visual Studio 2010 Tools Overview</strong> and<strong> Web Content Management in SharePoint 2010</strong>.  We covered a lot of ground in the first two and and they were very much an overview of all the features available.  Things like running SP on the desktop client (x64 win7 or vista), visual studio 2010 build, debug, deploy, the developer dashboard, Linq to SharePoint (YES), the ribbon and sandboxed solutions.</p>
<p>The final session (the web content management one) was a bit of a disappointment.  It was a level 300 session and seemed like they dumbed it down for beginners, i mean they were teaching us how to make web pages via the UI.   There was some interesting stuff in the presentation but at no point did they really dive in and demo things like the variation model improvements or content deployment fixes they have made.  It was just alluded to.</p>
<p>Either way it was a pretty good day...met some great people from all over the world so far and I hope that continues.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/conference' rel='tag' target='_self'>conference</a>, <a class='technorati-link' href='http://technorati.com/tag/SharePoint' rel='tag' target='_self'>SharePoint</a>, <a class='technorati-link' href='http://technorati.com/tag/SPC09' rel='tag' target='_self'>SPC09</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2009/10/20/sharepoint-conference-spc09-day-1-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Field Types&#8230;Building a base XML Field Type for SharePoint</title>
		<link>http://www.calvinirwin.net/2009/08/12/custom-field-types-seriously/</link>
		<comments>http://www.calvinirwin.net/2009/08/12/custom-field-types-seriously/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 23:47:10 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[custom field type]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=124</guid>
		<description><![CDATA[Sometimes when I am working with SharePoint I really feel like I got it.  You now that feeling you get when you know exactly what you are doing and have no problems implementing it...then there are times when I really just want to smash something.  And it really doesn't matter what...it could be anything!  This [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when I am working with SharePoint I really feel like I got it.  You now that feeling you get when you know exactly what you are doing and have no problems implementing it...then there are times when I really just want to smash something.  And it really doesn't matter what...it could be anything!  This is the feeling I got in the last couple of days working with custom field types in SharePoint.</p>
<p>It seems there are lots of blogs and articles out there talking about how to do it, but from what I could see (and to be fair I did not read them all so if you know of some good posts that would be great) it felt like most of the time I was only getting half the story.  I just finished putting together a very basic Custom Field Type that will display a multi line textbox in edit/new mode and simply display the value in a literal control in display mode.  In the grand scheme of things I am building a base XML Field Type to use for a series of additional Custom field types so essentially I want to store a string (yes I could use the XmlDocument)...but alas thats a story for another day.</p>
<p>So a bit of a primer, or rehash so I don't forget, when developing custom field types there are many pieces to it....not all of them required.  Here is a list of the items and what they do:</p>
<ul>
<li><strong>Field Type class </strong>- this class acts as the controller and hooks the rendering control, field type xml definition and the value class together.  It also provides validation at the field level via the GetValidatedString() method of the SPField object</li>
<li> <strong>Field Control class</strong> - this is the rendering engine and gives you the power to display your control in any manner you wish as well as perform validation on the data being saved via the UI.</li>
<li><strong>Field Value class</strong> - allows for custom logic to be put around mutiple column fields and different data structures that will be storing data for your field type.</li>
<li><strong>.ascx file in CONTROLTEMPLATES directory</strong> - this supplies rendering markup via a user control and hooks into the field control class</li>
<li><strong>fldtypes_*</strong> - this file that gets installed into the 12/TEMPLATES/XML directory and contains the information that SharePoint requires in order to load your field type into the system.  Such as the assembly to use, the parent type and other information.  This is required if the type is going to be applied to content types and become a field on a list.</li>
</ul>
<p>So for my requirements I only needed the field type, the field control and the fldtypes_xxx.xml file.  Lets look at the field type class I built</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> XmlFieldType : SPField
   <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">public</span> XmlFieldType<span style="color: #000000;">&#40;</span>SPFieldCollection fields, <span style="color: #FF0000;">string</span> fieldName<span style="color: #000000;">&#41;</span> : <span style="color: #0600FF;">base</span><span style="color: #000000;">&#40;</span>fields, fieldName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> XmlFieldType<span style="color: #000000;">&#40;</span>SPFieldCollection fields, <span style="color: #FF0000;">string</span> fieldName, <span style="color: #FF0000;">string</span> displayName<span style="color: #000000;">&#41;</span> : <span style="color: #0600FF;">base</span><span style="color: #000000;">&#40;</span>fields, fieldName, displayName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> BaseFieldControl FieldRenderingControl
        <span style="color: #000000;">&#123;</span>
            get
            <span style="color: #000000;">&#123;</span>
                BaseFieldControl fldControl = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> XmlFieldControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
                fldControl.<span style="color: #0000FF;">FieldName</span> = InternalName;
                <span style="color: #0600FF;">return</span> fldControl;
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">object</span> GetFieldValue<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> value<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>value<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">null</span>;
            <span style="color: #0600FF;">return</span> value;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> Type FieldValueType
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> <a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span> DefaultValue
        <span style="color: #000000;">&#123;</span>
            get
            <span style="color: #000000;">&#123;</span>
                XmlDocument doc = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> XmlDocument<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
                doc.<span style="color: #0000FF;">LoadXml</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">SchemaXml</span><span style="color: #000000;">&#41;</span>;
                XmlNode nodeInFieldSchema = doc.<span style="color: #0000FF;">SelectSingleNode</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Field/Default&quot;</span><span style="color: #000000;">&#41;</span>;
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nodeInFieldSchema != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                    <span style="color: #0600FF;">return</span> nodeInFieldSchema.<span style="color: #0000FF;">InnerXml</span>;
                <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">null</span>;
            <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">DefaultValue</span> = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span> GetValidatedString<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> value<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">GetValidatedString</span><span style="color: #000000;">&#40;</span>value<span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>value == <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Required</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">throw</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SPFieldValidationException<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Invalid value for required field.&quot;</span><span style="color: #000000;">&#41;</span>;
                <span style="color: #0600FF;">return</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span>;
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">else</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">return</span> value.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre>
<p>Lets review</p>
<ul>
<li>The two constructors are required...don't even bother</li>
<li><strong>FieldRenderingControl()</strong> method tells the field type which control to use</li>
<li><strong>GetFieldValue()</strong> method returns the value of the field....if we were using a custom type you would cast that to the appropriate type here</li>
<li><strong>FieldValueType()</strong> - get the type of the Value class</li>
<li><strong>DefautValue()</strong> - this gets the default value from the field if one is defined</li>
<li><strong>GetValidatedString()</strong> - perform field level validation</li>
</ul>
<p>The Field Control Class is fairly simple as well:</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> XmlFieldControl : BaseFieldControl
<span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">protected</span> Literal _values;
        <span style="color: #0600FF;">protected</span> TextBox _editor;
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnInit<span style="color: #000000;">&#40;</span>EventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnInit</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span>;
            EnsureChildControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> CreateChildControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Field</span> == <span style="color: #0600FF;">null</span> || <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">ControlMode</span> == SPControlMode.<span style="color: #0000FF;">Invalid</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">return</span>;
&nbsp;
            Controls.<span style="color: #0000FF;">Clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">CreateChildControls</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
            _editor = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> TextBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
            _editor.<span style="color: #0000FF;">TextMode</span> = TextBoxMode.<span style="color: #0000FF;">MultiLine</span>;
            _editor.<span style="color: #0000FF;">Height</span> = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Unit<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">300</span><span style="color: #000000;">&#41;</span>;
            _editor.<span style="color: #0000FF;">Width</span> = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Unit<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">500</span><span style="color: #000000;">&#41;</span>;
            Controls.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>_editor<span style="color: #000000;">&#41;</span>;
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>ControlMode == SPControlMode.<span style="color: #0000FF;">Display</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                _values = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Literal<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
                _values.<span style="color: #0000FF;">Text</span> = Convert.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span>ItemFieldValue<span style="color: #000000;">&#41;</span>;
                Controls.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>_values<span style="color: #000000;">&#41;</span>;
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> Render<span style="color: #000000;">&#40;</span>HtmlTextWriter output<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
&nbsp;
            EnsureChildControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>ControlMode == SPControlMode.<span style="color: #0000FF;">Display</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_values != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                    _values.<span style="color: #0000FF;">RenderControl</span><span style="color: #000000;">&#40;</span>output<span style="color: #000000;">&#41;</span>;
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">else</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_editor != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                    _editor.<span style="color: #0000FF;">RenderControl</span><span style="color: #000000;">&#40;</span>output<span style="color: #000000;">&#41;</span>;
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">virtual</span> <span style="color: #FF0000;">string</span> Text
        <span style="color: #000000;">&#123;</span>
            get
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">EnsureChildControls</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>._editor == <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">null</span>;
                <span style="color: #000000;">&#125;</span>
                <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">this</span>._editor.<span style="color: #0000FF;">Text</span>;
            <span style="color: #000000;">&#125;</span>
&nbsp;
            set
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">EnsureChildControls</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>._editor != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #0600FF;">this</span>._editor.<span style="color: #0000FF;">Text</span> = value;
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">object</span> Value
        <span style="color: #000000;">&#123;</span>
            get
            <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Text</span>; <span style="color: #000000;">&#125;</span>
            set
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Field</span> != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Field</span>.<span style="color: #0000FF;">GetFieldValueForEdit</span><span style="color: #000000;">&#40;</span>value<span style="color: #000000;">&#41;</span>;
                    <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Value</span> = <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>value;
                    <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">UpdateFieldValueInItem</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span></pre>
<p>Lets take a look at what this class is doing:</p>
<ul>
<li><strong>OnInit()</strong> - come on, do I have to explain?</li>
<li><strong>CreateChildControls() </strong>- initialize your controls and add to the Controls collection</li>
<li><strong>Render()</strong> - writes the controls to the HtmlTextWriter</li>
<li><strong>Text</strong> - This sets/gets the value in the controls</li>
<li><strong>Value</strong> - this sets the value in the Text property and notice the <strong>base.UpdateFieldValueInItem();</strong> statement...this oushes the value from Value to ItemFieldValue and allows you to access this value in display mode because Value returns null (which i did not find the documentation on M$ thank you very much).</li>
</ul>
<p>So that leaves the last piece of the pie for my simple implementation the fldtypes file:</p>
<pre class="xml"><span style="color: #ddbb00;">&amp;lt;</span>FieldTypes<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>FieldType<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;TypeName&quot;<span style="color: #ddbb00;">&amp;gt;</span>XmlFieldType<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;ParentType&quot;<span style="color: #ddbb00;">&amp;gt;</span><span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;InternalType&quot;<span style="color: #ddbb00;">&amp;gt;</span>Note<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;SQLType&quot;<span style="color: #ddbb00;">&amp;gt;</span>ntext<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;TypeDisplayName&quot;<span style="color: #ddbb00;">&amp;gt;</span>Xml Field<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;TypeShortDescription&quot;<span style="color: #ddbb00;">&amp;gt;</span>Xml controls<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;UserCreatable&quot;<span style="color: #ddbb00;">&amp;gt;</span>TRUE<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;ShowOnListCreate&quot;<span style="color: #ddbb00;">&amp;gt;</span>TRUE<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;Sortable&quot;<span style="color: #ddbb00;">&amp;gt;</span>FALSE<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;AllowBaseTypeRendering&quot;<span style="color: #ddbb00;">&amp;gt;</span>FALSE<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;Filterable&quot;<span style="color: #ddbb00;">&amp;gt;</span>FALSE<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Field Name=&quot;FieldTypeClass&quot;<span style="color: #ddbb00;">&amp;gt;</span>Website.CustomFields.XmlFieldType, Website.CustomFields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=346fcdd567259ee6<span style="color: #ddbb00;">&amp;lt;</span>/Field<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>RenderPattern Name=&quot;HeaderPattern&quot;<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Property Select=&quot;DisplayName&quot; HTMLEncode=&quot;TRUE&quot;/<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>/RenderPattern<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>RenderPattern Name=&quot;DisplayPattern&quot;<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>Column/<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>/RenderPattern<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>/FieldType<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>/FieldTypes<span style="color: #ddbb00;">&amp;gt;</span></pre>
<p>So there you have it.  All I need to do in order to inherit from this is to remove the rendering (which i dont need anyway  as this is going to be a base type) and it should be good to go.  Those three pieces of code can be installed into your SharePoint environment and should help you get started to understanding custom field types.</p>
<p><span style="color: #800000;"><em>Don't forget to add the SafeControl entry, Adjust your trust level and move the .dll into your bin folder as well.</em></span></p>
<p><a href="/files/FieldType.zip">Download the code here</a></p>
<p>Resources I found useful:</p>
<ul>
<li>I did work through the example in <a href="http://www.andrewconnell.com/blog/">Andrew Connell</a>'s book (Professional SP 2007 WCM development) and that worked fine and he actually does a great job of explaining most of whats going on here.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms446361.aspx">MSDN</a>...where else</li>
<li><a href="http://www.chaholl.com/archive/2009/07/18/custom-fieldtypes-ndash-part-1.aspx">Charlie Holland </a>has a pretty good article series on this stuff but unfortunately I couldn't get it working.  I also wanted a simple bare bones implementation.</li>
</ul>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 2968px; width: 1px; height: 1px;">Sometimes when I am working with SharePoint I really feel like I got it.  You now that feeling you get when you know exactly what you are doing and have no problems implementing it...then there are times when I really just want to smash something.  And it really doesn't matter what...it could be anything!  This is the feeling I got in the last couple of days working with custom field types in SharePoint.  It seems there are lots of blogs and articles out there talking about how to do it, but from what I could see (and to be fair I did not read them all so if you know of some good posts that would be great) it felt like most of the time I was only getting half the story.  I just finished putting together a very basic Custom Field Type that will display a multiline textbox in edit/new mode and simply display the value in a literal control in display mode.  In the grand scheme of things I am building a base XML Field Type to use for a series of additional Custom field types so essentially I want to store a string (yes I could use the XmlDocument)...but alas thats a story for another day.</p>
<p>So a bit of a primer, or rehash so I don't forget, when developing custom field types there are many pieces to it....not all of them required.  Here is a lit of the items and what they do:</p>
<p>* Field Type class - this class acts as the controller and hooks the rendering control, field type xml definition and the value class together.  It also provides validation at the field level via the GetValidatedString() method of the SPField object<br />
* Field Control class - this is the rendering engine and gives you the power to display your control in any manner you wish as well as perform validation on the data being saved via the UI.<br />
* Field Value class - allows for custom logic to be put around mutiple column fields and different data structures that will be storing data for your field type.<br />
* .ascx file in CONTROLTEMPALTES directory - this supplies rendering markup via a usercontrol and hooks into the field control class<br />
* fldtypes_* - this file that gets installed into the 12/TEMPLATES/XML directory and contrains the information that SharePoint requires in order to load your field type into the system.  Such as the assembly to use, the parent type and other information.  This is required if the type is going to be applied to content types and become a field on a list.</p>
<p>So for my requirements I only needed the field type, the field control and the fldtypes_xxx.xml file.  Lets look at the field type class I built</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> XmlFieldType : SPField
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">public</span> XmlFieldType<span style="color: #000000;">&#40;</span>SPFieldCollection fields, <span style="color: #FF0000;">string</span> fieldName<span style="color: #000000;">&#41;</span> : <span style="color: #0600FF;">base</span><span style="color: #000000;">&#40;</span>fields, fieldName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">public</span> XmlFieldType<span style="color: #000000;">&#40;</span>SPFieldCollection fields, <span style="color: #FF0000;">string</span> fieldName, <span style="color: #FF0000;">string</span> displayName<span style="color: #000000;">&#41;</span> : <span style="color: #0600FF;">base</span><span style="color: #000000;">&#40;</span>fields, fieldName, displayName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> BaseFieldControl FieldRenderingControl
<span style="color: #000000;">&#123;</span>
get
<span style="color: #000000;">&#123;</span>
BaseFieldControl fldControl = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> XmlFieldControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
fldControl.<span style="color: #0000FF;">FieldName</span> = InternalName;
<span style="color: #0600FF;">return</span> fldControl;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">object</span> GetFieldValue<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> value<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>value<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">return</span> <span style="color: #0600FF;">null</span>;
<span style="color: #0600FF;">return</span> value;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> Type FieldValueType
<span style="color: #000000;">&#123;</span>
get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> <a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>; <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span> DefaultValue
<span style="color: #000000;">&#123;</span>
get
<span style="color: #000000;">&#123;</span>
XmlDocument doc = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> XmlDocument<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
doc.<span style="color: #0000FF;">LoadXml</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">SchemaXml</span><span style="color: #000000;">&#41;</span>;
XmlNode nodeInFieldSchema = doc.<span style="color: #0000FF;">SelectSingleNode</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Field/Default&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nodeInFieldSchema != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">return</span> nodeInFieldSchema.<span style="color: #0000FF;">InnerXml</span>;
<span style="color: #0600FF;">return</span> <span style="color: #0600FF;">null</span>;
<span style="color: #000000;">&#125;</span>
set <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">DefaultValue</span> = value; <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span> GetValidatedString<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> value<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">GetValidatedString</span><span style="color: #000000;">&#40;</span>value<span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>value == <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Required</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">throw</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SPFieldValidationException<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Invalid value for required field.&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">return</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">return</span> value.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre>
<p>Lets review</p>
<p>* The two constructors are required<br />
* FieldRenderingControl() method tells the field type which control to use<br />
* GetFieldValue() method returns the value of the field....if we were using a custom type you would cast that to the appropriate type here<br />
* FieldValueType() - get the type of the Value class<br />
* DefautValue() - this gets the default value from the field if one is defined<br />
* GetValidatedString() - perform field level validation</p>
<p>The Field Control Class is fairly simple as well:</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> XmlFieldControl : BaseFieldControl
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">protected</span> Literal _values;
<span style="color: #0600FF;">protected</span> TextBox _editor;
&nbsp;
<span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnInit<span style="color: #000000;">&#40;</span>EventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnInit</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span>;
EnsureChildControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> CreateChildControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Field</span> == <span style="color: #0600FF;">null</span> || <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">ControlMode</span> == SPControlMode.<span style="color: #0000FF;">Invalid</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">return</span>;
&nbsp;
Controls.<span style="color: #0000FF;">Clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">CreateChildControls</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
_editor = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> TextBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
_editor.<span style="color: #0000FF;">TextMode</span> = TextBoxMode.<span style="color: #0000FF;">MultiLine</span>;
_editor.<span style="color: #0000FF;">Height</span> = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Unit<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">300</span><span style="color: #000000;">&#41;</span>;
_editor.<span style="color: #0000FF;">Width</span> = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Unit<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">500</span><span style="color: #000000;">&#41;</span>;
Controls.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>_editor<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>ControlMode == SPControlMode.<span style="color: #0000FF;">Display</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
_values = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Literal<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
_values.<span style="color: #0000FF;">Text</span> = Convert.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span>ItemFieldValue<span style="color: #000000;">&#41;</span>;
Controls.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>_values<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> Render<span style="color: #000000;">&#40;</span>HtmlTextWriter output<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
&nbsp;
EnsureChildControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>ControlMode == SPControlMode.<span style="color: #0000FF;">Display</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_values != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
_values.<span style="color: #0000FF;">RenderControl</span><span style="color: #000000;">&#40;</span>output<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_editor != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
_editor.<span style="color: #0000FF;">RenderControl</span><span style="color: #000000;">&#40;</span>output<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">virtual</span> <span style="color: #FF0000;">string</span> Text
<span style="color: #000000;">&#123;</span>
get
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">EnsureChildControls</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>._editor == <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">return</span> <span style="color: #0600FF;">null</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">return</span> <span style="color: #0600FF;">this</span>._editor.<span style="color: #0000FF;">Text</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
set
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">EnsureChildControls</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>._editor != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">this</span>._editor.<span style="color: #0000FF;">Text</span> = value;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">object</span> Value
<span style="color: #000000;">&#123;</span>
get
<span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Text</span>; <span style="color: #000000;">&#125;</span>
set
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Field</span> != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Text</span> = <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Field</span>.<span style="color: #0000FF;">GetFieldValueForEdit</span><span style="color: #000000;">&#40;</span>value<span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Value</span> = <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>value;
<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">UpdateFieldValueInItem</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre>
<p>sdfsdf</p>
<pre class="xml">    XmlFieldType
&nbsp;
    Note
    ntext
    Xml Field
    Xml controls
    TRUE
    TRUE
    FALSE
    FALSE
    FALSE
    Website.CustomFields.XmlFieldType, Website.CustomFields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=346fcdd567259ee6</pre>
<p>I did work through the example in Andrew Connell's book (Professional SP 2007 WCM development) and that worked fine and he actually does a great job of explaining most of whats going on here.</p>
<p>http://msdn.microsoft.com/en-us/library/ms446361.aspx</p></div>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/controls' rel='tag' target='_self'>controls</a>, <a class='technorati-link' href='http://technorati.com/tag/custom+field+type' rel='tag' target='_self'>custom field type</a>, <a class='technorati-link' href='http://technorati.com/tag/Development' rel='tag' target='_self'>Development</a>, <a class='technorati-link' href='http://technorati.com/tag/SharePoint' rel='tag' target='_self'>SharePoint</a>, <a class='technorati-link' href='http://technorati.com/tag/xml' rel='tag' target='_self'>xml</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2009/08/12/custom-field-types-seriously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
