SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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