Saturday, 5 May 2012

Image Webpart Color Picker Tool Part


I remember my role model who taught and got me started in SharePoint, one day told me that if you want to learn SharePoint, then better learn it from SharePoint. You will find SharePoint doing same what it expects from developers to create any SharePoint artifacts...hence SharePointRoot/ 12 hive folder is the best place to find working examples

This post talks about reusing some of the SharePoint pickers. SharePoint does use some nice pickers in many of its OOB functionalities. Take example of CQWP webpart. It uses Site/ List picker, Text Editors in its tool part. Many people have thrown light on how to reuse these pickers.

Site/ List Picker:

Custom Property Builders/ Text Editor:

Asset Picker/ Asset Url Picker:

Folder Picker:

There are many more... like audience picker, Picker containers etc.

Well, in my case, one of my clients wanted to have a color picker exactly like that of Image WebPart.

Figure 1: Image Webpart Color Picker


Hence I started digging into Image webpart code and it didn't take much to create a toolpart with Image webpart's color picker.

Figure 2: Custom Color Picker Toolpart


Unfortunately, this color pallet is very basic one and it does not have wide range of colors to pick from. But still, if you like it and want to use it in your assignments, here is the Source Code… Download the Source Code

Note:
The tooltip text used in tool part is not localized.

Time for a walk… daily walk of 4-5 kms is helping me against Insomnia.


No comments:

Post a Comment