SharePoint 2010 I like custom fieldtypes

It doesn’t matter if you are using a standard list or create a new list in SharePoint 2010 – you always make use of field types when you create your needed columns. Each column based on a field type. There are several field types available out-of-the-box. So you can use it for Columns from type text, number, multitext, choice, lookups, etc. But what if you are not happy with the available field types? Well, it’s SharePoint. Just create your own custom fieldtype – that’s easier said than done! But it’s possible.

What is necessary to create a custom fieldtype?

  1. Fieldtype Definition (XML File)
  2. Field Class (.cs File)
  3. Field Control Class (.cs File)
  4. [Optional] Custom XSLT Rendering listview
  5. [Optional] Rendering Template for Display, New and Edit form.

As you can see, a custom fieldtype is build by several files, which also has to be deployed into different folders of the 14 hive.

My custom fieldtype is for hyperlinks. I know there is already a fieldtype for hyperlinks and images. But there is no hyperlink fieldtype for opening hyperlinks in a new window. So I created a hyperlink fieldtype which does exactly this but also gives the user a choice how to open the hyperlink.

How to create a custom fieldtype

My posts about custom fieldtypes:

I put some more examples and good links below.

Resources

Developing a SharePoint custom field type for displaying CRM 4.0 data

How to: Create a Custom Field Type

Walkthrough: Creating a Custom Field Type

Available Field Types in SharePoint 2010

Creating a Custom Field Type for SharePoint 2010 (Email Validation Field)

Walkthrough: Custom field type for uploading and displaying images in SharePoint 2010 lists

As you can see there so many options to use custom fieldtypes, that you should like them.

..:: I LIKE SHAREPOINT ::..

The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.

Karsten Pohnke About Karsten Pohnke
He is Consultant for SharePoint Solutions for collaboration, communication and business processes. He provides his customers applications based on standard features as well as development or combining the power of several microsoft tools like Dynamics CRM. In his free time he tries to collect tipps and worthy experience in this blog.

Submit comment

Allowed HTML tags: <a href="http://google.com">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>
quote
</blockquote>

Please fill in the captcha: * Time limit is exhausted. Please reload CAPTCHA.