Expand=false for Tree view control

Hi 
I have a placed a tree view control on SharePoint 2010 master page  and given sitemap as a datasource.
and my tree view is displaying all the links from sitemap file.
But here the problem is all the node are getting expanded.
Is there any way to disable that.

Assuming you are using SPTreeview control you can set ExpandDepth property. This property gets or sets the number of levels that are expanded when a TreeView control is displayed for the first time.
Example: http://msdn.microsoft.com/en-us/library/ms466994(v=office.14).aspx
Amit

Similar Messages

  • Displaying icons in tree view control

    Hi all
            i am trying to display  icons in my tree view control.I am using beow code but i am not getting the ouput.Please help me.
    Type-pools : fibs,stree , ICON.
    data : t_node type snodetext.
    data : node_tab like t_node occurs 0 with header line,
           it_icon_id type icon-id.
    clear : node_tab, node_tab[].
    select single id from icon into it_icon_id
           where name = 'ICON_CUSTOMER'.
    node_tab-type = 'T'.
    node_tab-name = 'Earth'.
    node_tab-tlevel = '01'.
    node_tab-nlength = '5'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    node_tab-NODEICON = it_icon_id.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Europe'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    node_tab-NODEICON = it_icon_id.
    append node_tab.
    clear node_tab.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
    EXPORTING
      INSERT_ID                = '000000'
      RELATIONSHIP             = ' '
      LOG                      =
      TABLES
        NODETAB                  = node_tab
    EXCEPTIONS
      TREE_FAILURE             = 1
      ID_NOT_FOUND             = 2
      WRONG_RELATIONSHIP       = 3
      OTHERS                   = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
      DATA: wa_type TYPE stree_ctl_type_mapping.
      CLEAR: type_mapping[].
        wa_type-type = 'A'.
        wa_type-icon = '@A0@'.
        APPEND wa_type TO type_mapping.
    CALL FUNCTION 'RS_TREE_CONTROL_PREPARE'
    EXPORTING
        CONTROL_PATTERN             = 'PH'
        MULTIPLE_SELECTION          = 'X'
         TYPE_MAPPING                = type_mapping.
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
    LAYOUT_MODE                     = ' '
      USE_CONTROL                     = STREE_USE_LIST.
    Thank you.
    Regards
    Giri.

    Here is another option using <ICON> include,
    *& Report  ZKB_TREE_EXAMPLE
    REPORT  zkb_tree_example.
    INCLUDE <icon>.
    TYPES: BEGIN OF t_sbook,
            customid TYPE sbook-customid,
            fldate TYPE sbook-fldate,
            bookid TYPE sbook-bookid,
          END OF t_sbook.
    DATA: i_sbook TYPE TABLE OF t_sbook,
          w_sbook TYPE t_sbook.
    SELECT-OPTIONS: s_custid FOR w_sbook-customid.
    DATA: o_custom_container  TYPE REF TO cl_gui_custom_container,
          o_tree              TYPE REF TO cl_gui_simple_tree.
    TYPES: t_node_table LIKE TABLE OF trstree.
    DATA: i_node TYPE t_node_table,
          w_node TYPE LINE OF t_node_table.
    START-OF-SELECTION.
      CALL SCREEN 9000.
    *&      Module  status_9000  OUTPUT
          text
    MODULE status_9000 OUTPUT.
      SET PF-STATUS '9000'.
    ENDMODULE.                 " status_9000  OUTPUT
    *&      Module  user_command_9000  INPUT
          text
    MODULE user_command_9000 INPUT.
      CASE sy-ucomm .
        WHEN 'BACK' OR 'EXIT'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    ENDMODULE.                 " user_command_9000  INPUT
    *&      Module  init_9000  OUTPUT
          text
    MODULE init_9000 OUTPUT.
      DATA: lw_sbook TYPE t_sbook.
      SELECT customid fldate bookid FROM sbook
             INTO TABLE i_sbook WHERE customid IN s_custid.
      SORT i_sbook BY customid ASCENDING.
      CREATE OBJECT o_custom_container
           EXPORTING
                container_name              = 'TREE'
           EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
      IF sy-subrc <> 0.
        MESSAGE 'Error Creating Container' TYPE 'E'.
      ENDIF.
      CREATE OBJECT o_tree
           EXPORTING
               parent                      = o_custom_container
               node_selection_mode         =
                                 cl_gui_simple_tree=>node_sel_mode_single
           EXCEPTIONS
               lifetime_error              = 1
               cntl_system_error           = 2
               create_error                = 3
               failed                      = 4
               illegal_node_selection_mode = 5.
      IF sy-subrc <> 0.
        MESSAGE 'Error Creating Tree' TYPE 'E'.
      ENDIF.
    Add ROOT Folder
      CLEAR w_node.
      w_node-node_key  = 'ROOT'.
      w_node-text      = 'Root'.
      w_node-isfolder  = 'X'.
      APPEND w_node TO i_node.
      CLEAR lw_sbook .
      LOOP AT  i_sbook INTO w_sbook.
        IF lw_sbook-customid NE w_sbook-customid.
          lw_sbook-customid = w_sbook-customid.
          CLEAR w_node.
          w_node-node_key  = w_sbook-customid.
          w_node-text      = w_sbook-customid.
          w_node-relatkey  = 'ROOT'.
          w_node-relatship = cl_gui_simple_tree=>relat_last_child.
          w_node-isfolder  = 'X'.
          APPEND w_node TO i_node.
        ENDIF.
        CLEAR w_node.
        w_node-node_key  = w_sbook-bookid.
        w_node-relatkey  = w_sbook-customid.
        w_node-relatship = cl_gui_simple_tree=>relat_last_child.
        w_node-text      = w_sbook-bookid.
    <b>    w_node-n_image = icon_customer.</b>
        APPEND w_node TO i_node.
      ENDLOOP.
      CALL METHOD o_tree->add_nodes
        EXPORTING
          table_structure_name           = 'TRSTREE'
          node_table                     = i_node
        EXCEPTIONS
          failed                         = 1
          error_in_node_table            = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5.
      IF sy-subrc <> 0.
        MESSAGE 'Error Adding Node to Tree' TYPE 'E'.
      ENDIF.
    Expand tree
      CALL METHOD o_tree->expand_root_nodes
        EXPORTING
          level_count    = 2
          expand_subtree = ' '
        EXCEPTIONS
          OTHERS         = 1.
      IF sy-subrc <> 0.
        MESSAGE 'Error Expanding Tree' TYPE 'E'.
      ENDIF.
    ENDMODULE.                 " init_9000  OUTPUT
    Regards
    Kathirvel

  • Tree view control print

    Hi all
          I want to set a print option for the tree view control along with back,exit etc options.please help me to do this.
    Thanks in regards
    Regards
    Giri

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Natasa Stojovska ([email protected]):
    I have a few questions about a tree view control:
    1. If you put more than approximately 100 nodes in a tree, it populates too slow. There is no change if you try with query or record group. I figured that the populating of the record group makes all problems, but there is no chance to enlarge the array siye of the record group. Developer 6 has some built-ins which can do that, bu after many unsuccesful tries I don't see a solution.
    I tried to make fetches from cursor into a record group (30 nodes on a "page", but it looses a real hierarchy and you should do a lot of programming). If anybody knows how to make the population of the tree faster or have some template / please forward.
    <HR></BLOCKQUOTE>
    Try taking out the 'start with' and 'connect by' clauses in your select statement if you're using them. However, this will mean that you will have to determine the levels of the tree manually and ensure that the data comes out in the same order each time you execute the select statement.
    null

  • Tree view control - populating speed - over 100 nodes

    I have a few questions about a tree view control:
    1. If you put more than approximately 100 nodes in a tree, it populates too slow. There is no change if you try with query or record group. I figured that the populating of the record group makes all problems, but there is no chance to enlarge the array siye of the record group. Developer 6 has some built-ins which can do that, bu after many unsuccesful tries I don't see a solution.
    I tried to make fetches from cursor into a record group (30 nodes on a "page", but it looses a real hierarchy and you should do a lot of programming). If anybody knows how to make the population of the tree faster or have some template / please forward.
    2. After we put the patch 5 of developer6, tree view control is totally unpredictable. Usually its when you programmaticaly try to select a node (ftree.set_tree_selection)...Anybody have the same problems?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Natasa Stojovska ([email protected]):
    I have a few questions about a tree view control:
    1. If you put more than approximately 100 nodes in a tree, it populates too slow. There is no change if you try with query or record group. I figured that the populating of the record group makes all problems, but there is no chance to enlarge the array siye of the record group. Developer 6 has some built-ins which can do that, bu after many unsuccesful tries I don't see a solution.
    I tried to make fetches from cursor into a record group (30 nodes on a "page", but it looses a real hierarchy and you should do a lot of programming). If anybody knows how to make the population of the tree faster or have some template / please forward.
    <HR></BLOCKQUOTE>
    Try taking out the 'start with' and 'connect by' clauses in your select statement if you're using them. However, this will mean that you will have to determine the levels of the tree manually and ensure that the data comes out in the same order each time you execute the select statement.
    null

  • How to handle tree view control in business one ui sdk

    Hi,
    Can any guide me on how to handle tree view control in business one ui sdk?
    Thanking in advance.
    With Regards,
    Ram.

    Hi Ram,
    Nowadays there are some trouble with the treeview controls in Windows XP SP2 as you can see here:
    It is said that SAP will publish a treeview control in 2005 SP1.
    Hope helps,
    Ibai Peñ

  • To enable multiple selection for tree view in web ui .

    Hi Experts ,
    We have requirement to add a multiple selection to a tree view in web ui  for a standard view.
    Component: BP_HIER
    View: BP_HIER/EOVPHierarchyTreeV
    Currently only single select is enabled for this view. I have added the following code in the HTMl page to multi selection.
    selectionMode          = "<%= AccountHierarchy->selection_mode %>"
    <%--selectedRowIndexTable = "<%= AccountHierarchy->SELECTION_TAB %>"--%>
    And in "DO_INIT_CONTEXT " method I have added the following code to enable multi select.
    typed_context->accounthierarchy->set_selection_mode(
            iv_selection_mode = cl_bsp_wd_context_node_tv=>selmode_multi.
    But still multi selection is not working.
    Let me know if any code changes are required in method "EH_ONSELECT" to enable multi selection.
    Regards,
    Shweta Nimje

    Hi Shweta,
    Why did you comment attribute selectedRowIndexTable? Uncomment and try again.
    selectedRowIndexTable = "<%= AccountHierarchy->SELECTION_TAB %>"

  • CRVS2010 beta - ReportSource Property for new Viewer-Control for WPF

    Hello,
    I use the new Crystal Reports for Visual Studio 2010 Beta. There is a new Viewer-Control for WPF.
    But I don't know, where to specify the ReportSource.
    Thanks
    Peter
    Added the info into the subject line for this beta
    Edited by: Don Williams on Jun 30, 2010 8:21 AM

    Hi,
    O.K., in this way I can set the ReportSource Property, but if I use the load-method, the compiler don't "know" about the properties of the specific report.
    The code
    For Each crReportObject In rd.Section4.ReportObjects
    brings the message
    Fehler     16     "Section4" ist kein Member von "CrystalDecisions.CrystalReports.Engine.ReportDocument".     C:\VS2010\...     484     40     WpfBudget
    An other problem is, that "C:\Users\aTai\Documents\Visual Studio 2010\Projects\CrystalReportWpfApplication1\CrystalReportWpfApplication1\CrystalReport1.rpt" don't exist on an user computer.
    Thanks
    Peter

  • Icon in tree view control

    Hi all
           I want to display an icon in tree view.These icons must be displayed before the node.for this purpose i am using below code.But i didn't find the icon in my output.Please help me to do this.
    Thanks in advance.
    REPORT  ZTREEVIEW_TEST_PROGRAM no standard page heading.
    Type-pools : fibs,stree.
    data : t_node type snodetext.
    data : node_tab like t_node occurs 0 with header line.
    clear : node_tab, node_tab[].
    node_tab-type = 'T'.
    node_tab-name = 'Earth'.
    node_tab-tlevel = '01'.
    node_tab-nlength = '5'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    node_tab-NODEICON = 'C:\Program Files\SAP\FrontEnd\SAPgui\bitmap\l_b_odsa'.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Europe'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    node_tab-NODEICON = 'C:\Program Files\SAP\FrontEnd\SAPgui\bitmap\l_b_odsa.bmp'.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Germany'.
    node_tab-tlevel = '03'.
    node_tab-nlength = '7'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Berlin'.
    node_tab-tlevel = '04'.
    node_tab-nlength = '6'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Asia'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '4'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'India'.
    node_tab-tlevel = '03-'.
    node_tab-nlength = '5'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Bombay'.
    node_tab-tlevel = '04-'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
    EXPORTING
      INSERT_ID                = '000000'
      RELATIONSHIP             = ' '
      LOG                      =
      TABLES
        NODETAB                  = node_tab
    EXCEPTIONS
      TREE_FAILURE             = 1
      ID_NOT_FOUND             = 2
      WRONG_RELATIONSHIP       = 3
      OTHERS                   = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
      DATA: wa_type TYPE stree_ctl_type_mapping.
      CLEAR: type_mapping[].
        wa_type-type = 'A'.
        wa_type-icon = '@BL@'.
        APPEND wa_type TO type_mapping.
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
      LAYOUT_MODE                     = ' '
       USE_CONTROL                     = STREE_USE_LIST.
    Regards
    Giri

    Giri,
    you can use SAP standard icons only - see table ICON and include TYPE-POOLS: icon in your program.
    If you can't use standard icon, it will be more complex.
    Regards,
    Clemens

  • Tree view control font size

    Hello,
    (LabVIEW 8.0): I have found that the font size of the tree view items can be set at design time from the drop down list on the menu bar.  However, is it possible to make each "level" (i.e. parent = a level, child = different level, grandchild = still another level) have a different font size to clearly differentiate one level from the next?
    Thanks,
    Chris 

    try a property node...
    Attachments:
    Clipboard-2.jpg ‏76 KB

  • Minimum rights for remote view/control

    I am in the process of cleaning up rights in my eDirectory because our last Novell admin was quit liberal with assigning rights. What I need to know is what are the minimum rights needed to remote view a workstation and what the minimum rights needed to remote control a workstation. I have been searching Google and the forums for a while with no luck.

    Originally Posted by mbreiden
    On Wed, 30 Jul 2008 15:16:02 GMT, geistc wrote:
    [color=blue]
    write to the action you want to allow
    read to mac address
    DIDAS AG
    Thanks for the quick response.
    I ran through the wizard and then looked at rights it gave the account. It looks like the attributes are as follows:
    Remote Control:
    DM:Remote Control -- write
    WM:Network Address -- read
    Remote View:
    DM:ZEN Remote View -- write
    WM:Network Address -- read
    The only thing I wanted to verify was, do I need to give those rights to the user objects as well as the workstation objects in order for this to work? I know some of the techs use C1 and right-click on the user, then select 'Remote Management'. Just not sure if I need to give rights to the user objects as well since the user will be logged in at the time the tech will be remote controlling/viewing.

  • JSF tree view GUI component and tree node actions

    Hi,
    I am new in using JSF and have a problem with my simple test application.
    The application contains a tree view control with one static tree node and a separate text area. Clicking on the tree node shall fill the text area with the string 'hello'. Seems to be very simple, but it doesn't work.
    What did I do?
    First of all I use the Sun Java Studio Creator 2.
    By double clicking on the tree node in the design window of the IDE a method called treeNode1_action() was created. I also added the String text to the session bean. treeNode1_Action() does not more than setting text='hello' ( getSessionBean().setText('hello'); ).
    The jsp file contains the line
    <ui:textArea binding="#{Page1.textArea}" id="textArea" style="height: 192px; left: 360px; top: 48px; position: absolute; width: 456px" text="#{SessionBean1.text}"/>, so the text of the text area is bound to the session property 'text'.
    Running the application and clicking on the tree node does nothing except reloading the page (no 'hello' inside the text area).
    Using the debugger showed me that the bean property text is set correctly to 'hello', also after reloading the page.
    What did I do wrong?
    What do I have to do to display 'hello' in the text area?
    I would be glad for some good advice to solve my problem and looking forward for an answer.
    Regards from germany
    Matthias

    want to remove the green patch from the jsf tree componentas u said ,, it is COMPONENET so this is a pre-made creator component that u cant chnage its attributes ,,
    instead u can extract Theam.jar file and change the icons ,, u i didnt do it before ,, but u may be find what u want there,
    hope this will help
    good luck
    Mohammed

  • Tree view display with ztable data

    Hello...
    I have seen this post.................
    Tree View
    My requirement is to create a Tree view .... looked around a lot but no detailed explanation to this topic. along  with this forums detials i looked into the standard BSP Component CRM_THTMLB_COMP for tree view help. I am new to MVC so lost at some point.
    Accordingy to this explanation i was able to achive the tree structure in the value node...
    But how to display data in tree? what codes need to be put in the get ...set methods..
    Actually i created  a table view and the value node is refereing to my ztable....so all the get and set methods are in this impl class. and the new impl class to tree structure does not have these methods...should i create all of them again ...or can i refer to the value node impl class get and set methods.....what code needs to be called in the get and set methods.
    if anyone can give me some help on this............
    Jaya.

    this wiki will help you.
    http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebUI--DynamictabletypeContext+nodes
    Regards,
    Harshit

  • SharePoint Report viewer control JavaScript API

    Hi,
    We are using SharePoint report viewer web part to show SSRS reports in SharePoint 2010. We need to perform some HTML manipulation (to avoid scrollbars) after the report has completed loading. 
    - What is the best way to identify report loaded event in client side JS?
    - I have read about client side JS API for report viewer control in ASP .NET. Does SharePoint report viewer webpart have the similat functionality?
    Thanks

    Hello,
    I think this thread will help you:
    https://social.technet.microsoft.com/Forums/en-US/104d59f5-e6db-4933-8c5f-2f06ac116bfe/remove-report-viewer-scrollbars?forum=sharepointgeneralprevious
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Scrolling in html viewer control

    hi
    I placed a html viewer contol in my tab page.How to enable scrolling  for html viewer control.Can anyone help me out in this ?

    It should happen automatically... have a look at the demo program SAPHTML_DEMO1 and try going to, say, www.google.com and execute a search - you should see the scroll bar activate as the results page lenght is greated the control size.
    Jonathan

  • How to set the font for table view contol

    Dear All,
    My requirement is to set Font type = Arial and size=1 for
    Table View control. The same font should be for  header, Rows and footer.
    One way we are achieving it through the Renderer class. Where in we are we are supplying data, colums with html font tags.
    Is there any simple way to fix font fot the entire TableView.
    Thanks
    Markandeya

    An approach I've used is to override the CSS styles by adding code like the following to the top of the JSP page.  It's a bit of a hack, but it did the job.  You will need to find ALL the styles used in a table view, and override the font size.
    <%-- OVERRIDE SOME CSS STYLES SO WE HAVE THE DESIRED TABLE CELL PADDING --%>
    <style>
    <!--
    .sapTbvCellStd {
         PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
    .sapTbvCellAlt {
         PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
    //-->
    </style>

Maybe you are looking for