Assuming I have a term set with all the countries. The first level is the continents The second level is the countries. No I am building a web part with a dropdown of the continents and a WebTaggingControl from the term set. How can I force the WebTaggingControl to show only the continent selected in the dropdown?

The actual usage is not with countries but this is a good representation of the issue :-)

Thanks in advance

1 Answer 1


It could be accomplished by specifying AnchorId property for TaxonomyWebTaggingControl control.
This property allows to specify ID of parent Term for any valid value in control.

Assume we have the following structure for the countries:

  • the first level is the continents
  • the second level is the countries

enter image description here

If we initialize TaxonomyWebTaggingControl control and specify for AnchorId Europe Term Id value

 /// <summary>
/// Initializing TaxonomyWebTaggingControl control
/// </summary>
/// <param name="countryControl"> </param>
/// <param name="session"></param>
/// <param name="continentTerm"></param>
private void InitCountriesControl(TaxonomyWebTaggingControl countryControl, TaxonomySession session, Term continentTerm)
    countryControl.SSPList = continentTerm.TermStore.Id.ToString();
    countryControl.AnchorId = continentTerm.Id;
    countryControl.TermSetList = continentTerm.TermSet.Id.ToString();

then only countries for selected continent will be displayed

enter image description here

For more details and how to implement Country picker based on Countries term set please see my blog - Using SharePoint TaxonomyWebTaggingControl control: specifying parent terms

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.