RioterDeckers' HeadQuarter

Our opinions about Microsoft technologies and the way we are working with.
Welcome to RioterDeckers' HeadQuarter Sign in | Join | Help
in Search

Avalonboy

Build your own SharePoint 2007 Picker Dialog

In all most of the time, people are using the famous Control "DropDownList" to put a collection of data. But, what happen when this list is so huge and may a performance issue for loading your page? Even if you do that, you are killing your End-Users by scrolling in a long list. It's not a good idea for your Users. So, what we can do? The "Dialog Picker" will be your help.

I think, you will already experience with it when you try looking for Users, Groups, Audiences,... To provide its own in SharePoint 2007 is very simple, it provides you all the needed base classes which you need to inherit from. Let's start implementing step by step each control.

Step 1: Editor

Build a class that inherits from "Microsoft.SharePoint.WebControls.EntityEditorWithPicker". After that you have to provide the type of the dialog (step 2) in the "PickerDialogType" property. Then, provides the separator char in the "EntitySeparator" property.

See below the Editor:

SharePointDialogPicker

Step 2: Dialog

Build a class that inherits from "Microsoft.SharePoint.WebControls.PickerDialog". This base class is responsible to provide results that matches with the entered text provided in the search input.

See below the dialog:

SharePointDialog

The base class constructor has 3 parameters:

  1. Query (Step 3) contains the logic for retrieving data
  2. A Control that display the result set
  3. An instance of the Editor (Step 1)

Step 3: Query

Build a class that inherits from "Microsoft.SharePoint.WebControls.SimpleQueryControl". In this class, you have to override the method "IssueQuey" which will contains the logic for retrieving Data, it must be in a "System.Data.DataTable". And sets it to the PickerDialog's Results property. Don't forget to return the row count. Otherwise, no result are displayed.

In addition, override the method "GetEntity" that has a "System.Data.DataRow" parameter. This Row is a DataTable you have provided before. The goal is this method in to Strongly Typed your result with the "Microsoft.SharePoint.WebControls.PickerEntity" object. Which you can specify a Key, DisplayText. Then, the "IsResolved" property to true. This ensures that the provided entity is correct.

See blow the output of the Dialog (Step 2) that populates data corresponding to the entered input text:

SharePointPickerEntityResolved

When click on the OK button, the editor will receive the Entity value separated by the specified "EntitySeparator" if there is more than one Entity.

See the final result in the Picker Editor:

SharePointPickerEditorResult

Hope it helps.

Published Friday, October 19, 2007 12:40 AM by avalonboy
Filed Under: ,

Comments

 

people » Build your own SharePoint 2007 Picker Dialog said:

October 21, 2007 8:28 AM
 

.neting in the free world said:

O co chodzi? Pierwsza część nazwy jest chyba zrozumiałą, zwykłe pole lookup, które umożliwia pobieranie
September 14, 2008 5:25 PM
 

SharePiont field with custom picker | keyongtech said:

January 18, 2009 9:38 AM
Anonymous comments are disabled

This Blog

Post Calendar

<October 2007>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Syndication

Powered by Community Server, by Telligent Systems