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?
- Fieldtype Definition (XML File)
- Field Class (.cs File)
- Field Control Class (.cs File)
- [Optional] Custom XSLT Rendering listview
- [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:
- SharePoint 2010 Access other fields of a form of custom fieldtype
- SharePoint 2010 loading templates from subfolders
- SharePoint 2010 A custom fieldtype for Hyperlinks
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 ::..
Leave a Reply
You must be logged in to post a comment.