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.
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.
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.
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.