Zum Hauptinhalt wechseln

Wiki

Startet die Suche
Home
Blog
Developments
FAQ
Wiki
Sonstiges
Kontakt
Suche
Impressum
  
Hezser.de > Wiki > Wiki-Seiten > IsSupportedForLookup()  

IsSupportedForLookup()

 RSS-Feed
If you create a lookup field programatically, you have to specify the field, which will be shown.
The only two supported field types are text and calculated.
 

/// <summary>
///
only SPFieldText and SPFieldCalculated are supported as LookupFields
/// </summary>
///
<param name="field"></param>
///
<returns></returns>
public static bool IsSupportedForLookup(this SPField field)
{
   
return field.Type == SPFieldType.Text || field.Type == SPFieldType.Calculated;
}

 

Usage:

SPField field = list.Fields[0];

if (field.IsSupportedForLookup() == false)

   // choose another field

Zuletzt geändert am 03.12.2008 18:28  von René Hézser