Manually adjust plus, minus and spinner icons

4 posts, 0 answers
  1. vandenbroele
    vandenbroele avatar
    17 posts
    Member since:
    Sep 2007

    Posted 24 Apr 2012 Link to this post

    Hello

    I have a simple ASP.net handler which returns objects via JSON.
    I want to use RadTreeView to display nodes corresponding to it.

    All works fine, except I cannot find a way to control the icons (plus, minus and spinner) manually.
    My JSON objects contain a flag "hasChildren" and the JSON is only one level deep per request.

    I can make requests, get child objects, add them to the telerik tree, recursive if needed, etcetera ... but I cannot find how to manually visualize this ajax/loading behaviour and the "hasChildren" flag.

    I noticed that the ExpandMode property on a node is related to this.. however I think it is not an option since it is 0 by default = TreeNodeExpandMode.ClientSide

    Any help?
  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 27 Apr 2012 Link to this post

    Hi,

     
    It is not very clear what are you trying to achieve. I am attaching a sample web page where is shown one way how to initialize RadTreeView from some JSON. 

    As for the plus and minus icons you can change them with the help of the following CSS classes: rtPlusrtMinus.

    Hope this will be helpful.

    Kind regards,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. vandenbroele
    vandenbroele avatar
    17 posts
    Member since:
    Sep 2007

    Posted 27 Apr 2012 Link to this post

    The server returns only JSON objects with one level of depth at a time. The objects have a flag "hasChildren".

    The problem is that the TreeView will not show the plus icon, because after the first request .. there literally are no children, anywhere.
    My script requests the children of a node when clicked on .... and only thén the icon will appear.

    Right now, I have solved it by adding a dummy node when the node/object has the "hasChildren" flag.
  5. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 01 May 2012 Link to this post

    Hi,

    RadTreeView does not have such property that takes care of adding and removing the plus/minus sign in a RadTreeNode so I will recommend you to continue using your workaround. Please excuse us for this limitation of our control.

    Greetings,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top