This topic has not yet been rated - Rate this topic

TaxonomyField.TextField Property

SharePoint 2010

Gets or sets the GUID that identifies the hidden text field in an item.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
public Guid TextField { get; set; }

Property Value

Type: System.Guid
A Guid object that identifies the hidden text field in an item.

Every TaxonomyField object contains a related hidden text field that contains a string representation of the taxonomy field value. The hidden text field is identifiedby the GUID returned by this property.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Link TaxonomyField to Term Store programmatically
TaxonomySession session = new TaxonomySession(Your_SPSite);
TermStore store = session.DefaultKeywordsTermStore;

Group grp = store.Groups.SingleOrDefault(o => o.Name == "Name_Of_Your_Term_Group");

List<TermSet> terms = new List<TermSet>();
foreach (TermSet termSet in grp.TermSets)
{
     terms.Add(termSet);
}

//Update Clowns List 
SPList listLeaders = web.Lists["Clowns"];

TaxonomyField taxonomyFieldRegion = (TaxonomyField)list.Fields[Name_Of_Your_Taxonomy_Field];
TermSet termRegion = terms.SingleOrDefault(o => o.Name == taxonomyFieldRegion.Title);
taxonomyFieldRegion.TermSetId = termRegion.Id;
taxonomyFieldRegion.SspId = termRegion.TermStore.Id;
taxonomyFieldRegion.Update();