Try Now
More in this section

Forums / Developing with Sitefinity / HierarchicalTaxonField Control

HierarchicalTaxonField Control

3 posts, 0 answered
  1. Thomas Weidman
    Thomas Weidman avatar
    38 posts
    19 Apr 2004
    16 Aug 2011
    Link to this post

    I'm using a HierarchicalTaxonField on a page and am trying to set the selected value for the control.  I've tried via JavaScript and code behind without any success.

    Here is the control definition on my page:

            WebServiceUrl="~/Sitefinity/Services/Taxonomies/HierarchicalTaxon.svc" />

    Then via C# I've tried setting the value like this:

    HierarchicalFieldControl.Value = categoryId;

    That did not work, so I also tried setting it via JavaScript.  The function is executed through Sys.Application.add_load, and the code to invoke the action looks like this:

    hierarchicalFieldControl = $get('<%= HierarchicalFieldControl.ClientID%>');

    And unfortunately that did not work either, but it did produce the following error:

    "Guid should contain 32 digits with 4 dashes"

    Which happened when the control attempted to perform a service call.  I checked both instances of code to confirm the categoryId values were proper GUIDs and the were both formatted like this:


    Any insight or suggestions would be appreciated.


  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    03 Nov 2014
    19 Aug 2011
    Link to this post
    Hello Thomas Weidman,

    When BindOnServer is true the Value of this field is cast to TrackedList<Guid>, which in turn inherits from IList<T>, ICollection<T>, etc., so all you need to do is create a new instance of this class and add the GUIDs of the selected taxonomies to it.

    Lubomir Velkov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Chris
    Chris avatar
    3 posts
    13 Feb 2013
    22 Oct 2013 in reply to Lubomir Velkov
    Link to this post
    I've run into this problem myself and still haven't found a solution. Setting the Value to a TrackedList of Guids does nothing.

    See this thread: 
3 posts, 0 answered