SharePoint內建的自定義欄位類型

1、單行文本 - SPFieldText
    這個可能是用的最為廣泛的類型了,它的輸入界面就是一個單行文本框,沒有數據驗證功能(除了是否為null)。可以設置最大長度(侷限在255以內)。
2、多行文本 - SPFieldMultiLineText
   輸入界面是一個textarea,根據設置不同,可以是純文字或者是增強型RTF(按照html格式保存的)。
3、數字 - SPFieldNumber
   輸入界面是textbox,但是帶有數據驗證(是否為數字,以及最大/最小值等)。
4、貨幣 - SPFieldCurrency
   和數字其實差不多,只不過現實的時候會多一個貨幣符號。
5、是/否 - SPFieldBoolean
   一個CheckBox
6、日期 - SPFieldDateTime
  一個帶picker的textbox,可以選擇「日期和時間」或「僅日期」
7、選項(單選) - SPFieldChoice
   可以以dropdownlist或者radio button的形式出現。這個有點點特別,雖然它看上去只能存一個值,但其實它是多選類(SPFieldMultiChoice)的子類……
以上可以算是簡單類型
8、選項(多選) - SPFieldMultiChoice
   如果使用多選,那麼是通過一組checkbox輸入的。在這個類裡面定義了這個字段中究竟有哪些選項(通過Choices屬性,自然,作為它子類的SPFieldChoice也有這個屬性)。於之相對應的,可以通過SPFieldMultiChoiceValue類來訪問它的值。
9、評估範圍 - SPFieldRatingScale
   剛才介紹過了,它其實也是多選類(SPFieldMultiChoice)的子類。於之對應的值類型為SPFieldRatingScaleValue。
10、鏈接或圖片 - SPFieldUrl
   可以是鏈接,也可以是圖片,它包含url和描述信息兩個部分,通過其值類型SPFieldUrlValue可以很方便的得到這兩部分。

11、查閱項 - SPFieldLookup
   通過dropdownlist完成單選,一個特殊的listbox完成多選(wss3.0支持查閱項多選了!),由於每個被查閱的項會有id和文本,所以也需要有值類型,這個比較特殊,有兩種值類型,SPFieldLookupValue和SPFieldLookupValueCollection(因為支持多選了嘛)。然後在SPFieldLookup類中,定義了要查閱哪個列表的哪個字段,以及是哪個網站上的列表。是的!wss3.0中的查閱項其實是支持跨網站查閱的(通過設定LookupWebId屬性),但是在默認的界面上並沒有暴露出一點。所以一個跨網站查閱項是一個很值得一做的自定義字段類型!
12、用戶和用戶組 - SPFieldUser
   它的輸入是通過一個帶有AJAX支持的輸入框完成的,這是一個很強大的控件。其實這個類是SPFieldLookup的子類,因為它們做的事情在本質上都差不多。相應的,其值類型SPFieldUserValue也是SPFieldLookupValue的子類,還有SPFieldUserValueCollection……
13、多欄 - SPFieldMultiColumn
   這是另一個很特殊的字段類型,默認情況下我們無法直接使用它,使用它的唯一途徑就是通過自定義字段類型繼承它來完成我們的需求。顧名思義,這是一個能在一個字段中儲存多個信息的字段類型。

Classname
Type
TypeAsString
TypeDisplayName
TypeShortDescription

Microsoft.SharePoint.SPFieldBoolean
Boolean
Boolean
Yes/No
Yes/No (check box)

Microsoft.SharePoint.SPFieldCalculated
Calculated
Calculated
Calculated
Calculated (calculation based on other columns)

Microsoft.SharePoint.SPFieldChoice
Choice
Choice
Choice
Choice (menu to choose from)

Microsoft.SharePoint.SPFieldComputed
Computed
Computed
Computed
Computed

Microsoft.SharePoint.SPFIeld
ContentTypeId
ContentTypeId
Content Type Id
Content Type Id

Microsoft.SharePoint.SPFieldCurrency
Currency
Currency
Currency
Currency ($, ¥, €)

Microsoft.SharePoint.SPFieldDateTime
DateTime
DateTime
Date and Time
Date and Time

Microsoft.SharePoint.SPFieldFile
File
File
File
File

Microsoft.SharePoint.SPField
Guid
Guid
Guid
Guid

Microsoft.SharePoint.SPFieldNumber
Integer
Integer
Integer
Integer

Microsoft.SharePoint.Portal.WebControls.BusinessDataField
Invalid
BusinessData
Business data
Business data

Microsoft.SharePoint.Publishing.Fields.ContentTypeIdFieldType
Invalid
ContentTypeIdFieldType
Content Type Id
Content Type Id

Microsoft.SharePoint.Publishing.Fields.HtmlField
Invalid
HTML
Publishing HTML
Full HTML content with formatting and constraints for publishing

Microsoft.SharePoint.Publishing.Fields.ImageField
Invalid
Image
Publishing Image
Image with formatting and constraints for publishing

Microsoft.SharePoint.Publishing.Fields.LayoutVariationsField
Invalid
LayoutVariationsField
Variations
Page Layout Variations

Microsoft.SharePoint.Publishing.Fields.LinkField
Invalid
Link
Publishing Hyperlink
Hyperlink with formatting and constraints for publishing

Microsoft.SharePoint.Publishing.Fields.PublishingScheduleEndDateField
Invalid
PublishingScheduleEndDateFieldType
Publishing Schedule End Date
Publishing Schedule End Date

Microsoft.SharePoint.Publishing.Fields.PublishingScheduleStartDateField
Invalid
PublishingScheduleStartDateFieldType
Publishing Schedule Start Date
Publishing Schedule Start Date

Microsoft.SharePoint.Publishing.Fields.SummaryLinkField
Invalid
SummaryLinks
SummaryLinks
Summary Links data

Microsoft.Office.Server.WebControls.FieldTypes.SPFieldTargetTo
Invalid
TargetTo
Audience Targeting
Audience Targeting

Microsoft.SharePoint.SPFieldLookup
Lookup
Lookup
Lookup
Lookup (information already on this site)

Microsoft.SharePoint.SPFieldLookup
Lookup
LookupMulti
Lookup
Lookup (information already on this site)

Microsoft.SharePoint.SPFieldNumber
Number
Number
Number
Number (1, 1.0, 100)

Microsoft.SharePoint.SPFieldRecurrence
Recurrence
Recurrence
Recurrence
Recurrence

Microsoft.SharePoint.SPFieldMultiLineText
Note
Note
Multiple lines of text
Multiple lines of text

Microsoft.SharePoint.SPFieldText
Text
Text
Single line of text
Single line of text

Microsoft.SharePoint.SPFieldUrl
URL
URL
Hyperlink or Picture
Hyperlink or Picture

Microsoft.SharePoint.SPFieldUser
User
User

posted on 2009-03-04 19:35  heavencoud  阅读(549)  评论(0编辑  收藏  举报

导航