Tree control tag with keyboard

I'm using a tree control and navegating with the keyboard arroy. When a choose a specific tag, i do a double click and call for a subvi. I need do the same thing when i press Enter Key, but the event Key Down don't return the tag of the tree control like the event Double Click. There's a way to do this with the keyboard?
Thanks for the help.

You could simply read the tree control's value:
Message Edited by smercurio_fc on 06-05-2007 02:40 PM
Attachments:
Example_BD.png ‏5 KB

Similar Messages

  • Can't control iTunes with keyboard after 10.5 update?

    Hi everyone.
    I run Win7 Ultimate x64 and have a Microsoft Wireless Laser Keyboard 6000 v.2
    The keyboard has a row of buttons along the very top to control media players; play/pause, skip between tracks, etc.
    Up until I updated to iTunes 10.5, I was able to use those buttons to pause and skip between tracks in iTunes, but iTunes didn't have to be my active window - I could be, say, composing this post with iTunes playing, but minimized to the task bar, an hit a keyboard button to pause or skip forward.
    I can no longer do that - I now have to actually go to the iTunes window in order to control it, or hold my mouse over iTunes in the task bar and I get a little back/forward/pause button that I can use to skip.
    In any case, this is extremely annoying and I'm wondering if anyone else has encountered this issue and if there are any workarounds.
    Thanks

    rageboy04,
    For issues with third-party software (software not made by Apple in this case), that interacts with Apple software, I would recomend contacting the maker of that application.
    Often with any application that controls another application, whether it is iTunes or anything else, when one is updated, the other needs to be updated as well.
    Thank you,
    Nathan C.

  • Control surface with keyboard controller

    I'm fairly new to Logic and sequencing (but not Macs) so I'm on a steep learning curve.
    I set up Logic with a Yamaha 01x as an interface and control surface. That's working o.k (after some dramas). I play software synths with an Edirol PCR controller keyboard. What I want to do dedicate the 01x to sequencer and mixing duties and assign the keyboard knobs and sliders to soft synth controls, (preferably globally - as in not plug-in by plug-in). When I try to use the learn function on a soft synth it doesn't want to take the assignment. It flashes the name of the keyboard briefly then reverts back to the name of the 01x port. I'm thinking it has something to do with the fact the keyboard is a separate USB midi interface. Whatever it is, I don't know where to find a set-up page for the keyboard or the combination of the keyboard and the 01x. Funny thing is, setting up my keyboard is so easy in MainStage which is part of the same software suite.
    I can't find anything in the manual that deals with this sort of hardware controller combination. Any help would be greatly appreciated.

    I still can't get this working so I am posting some more information in case someone can see a glaring hole in my logic (pun definitely intended).
    I have tried setting up controller assignments in both the Logic preferences and by the learn function within the plug-ins. My keyboard is a USB MIDI interface but it is not seen as a control surface by Logic. (As you say, Bee Jay, that's a good thing). It is sending out notes and controller messages on its own discrete port, port 1 (of two), channel 1. The synths in MainStage can see my keyboard and my control surface just fine. I can't see why it should be any different with Logic? Certain controllers always work (pitch bend, mod wheel pan volume and aftertouch). I have not been able to assign any of the other controls of any soft synth. Even if I set the soft synth destination to receive a source I know the keyboard is putting out (I can see it on the transport bar input display), it still doesn't work the control. I've tried deleting all "learned" controllers and starting again - Many times now.
    Needless to say, I'm getting to that stage. . .

  • Control animation with keyboard

    http://java.sun.com/products/java-media/2D/samples/suite/Image/DukeAnim-pi.html
    Is there anyway that one could control the movement of something like this (the walking thing) with wasd or the arrows???
    Thomas

    duplicate post:
    http://forum.java.sun.com/thread.jspa?threadID=616859&tstart=0

  • Controlling sliders with keyboard cursor

    I don't know whether this is trivial or not but does anyone know how to control the sliders with the cursor keys? e.g. up-down cursor for up-down slider left-right for left-right slider.

    Give the control focus (Using TAB key)
    the SHIFT and arrow (UP)
    Interestingly its the same for both sliders
    (Ergonimic disaster or Windows native)?

  • Change the selection of tree control with a right click

    How is it possible to change the item selected in a tree control (LabVIEW7) with a mouse right click ?

    Filippo,
    Here is a popup menu toolkit, with an additional example for a listbox. If I
    understand your problem, it shouldn't be hard to change it to a tree
    control.
    Regards,
    Wiebe.
    "Filippo" wrote in message
    news:[email protected]..
    > Sorry for my english ! If you can send me an example, it could be very
    > useful for me.
    > My e-mail is : [email protected]
    > Thanks.
    > Regards,
    >
    > Filippo
    [Attachment Menu 042004.zip, see below]
    Attachments:
    Menu_042004.zip ‏175 KB

  • Single click on tree control navigation

    Hello I have a tree control where I have include the navigation, I know that there is a method
    HANDLE_NODE_DOUBLE_CLICK FOR G_TREE
    but is there an method for only one click, I want to change my alv grid data when I click on several nodes in my tree control

    Hello Muhammet
    I have re-written my sample report ZUS_SDN_TWO_ALV_GRIDS into ZUS_SDN_TREE_AND_GRID_CONTROL which is now display a tree control together with the ALV grid.
    When you analyze this new report you will see that every step of the program logic is as I described in my previous e-mails.
    *& Report  ZUS_SDN_TWO_ALV_GRIDS
    *& Screen '0100' contains no elements.
    *& ok_code -> assigned to GD_OKCODE
    *& Flow logic:
    *  PROCESS BEFORE OUTPUT.
    *    MODULE STATUS_0100.
    *  PROCESS AFTER INPUT.
    *    MODULE USER_COMMAND_0100.
    *& Thread: single click on tree control navigation
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1143770"></a>
    REPORT  zus_sdn_tree_and_grid_control.
    TYPE-POOLS: abap, cntl.
    TYPES: node_table_type LIKE STANDARD TABLE OF mtreesnode
             WITH DEFAULT KEY.
    * CAUTION: MTREESNODE is the name of the node structure which must
    * be defined by the programmer. DO NOT USE MTREESNODE!
    CONSTANTS:
      BEGIN OF c_nodekey,
        root   TYPE tv_nodekey VALUE 'Root',                    "#EC NOTEXT
        child1 TYPE tv_nodekey VALUE 'Child1',                  "#EC NOTEXT
    *    child2 type tv_nodekey value 'Child2',                  "#EC NOTEXT
        new1   TYPE tv_nodekey VALUE 'New1',                    "#EC NOTEXT
        new2   TYPE tv_nodekey VALUE 'New2',                    "#EC NOTEXT
    *    new3   type tv_nodekey value 'New3',                    "#EC NOTEXT
    *    new4   type tv_nodekey value 'New4',                    "#EC NOTEXT
      END OF c_nodekey.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_cell_left     TYPE REF TO cl_gui_container,
      go_cell_right    TYPE REF TO cl_gui_container,
      go_tree          TYPE REF TO cl_gui_simple_tree,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
    **  go_grid2         TYPE REF TO cl_gui_alv_grid,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gt_knb1          TYPE STANDARD TABLE OF knb1,
      gt_knvv          TYPE STANDARD TABLE OF knvv.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_knb1      TYPE knb1.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
    **    CALL METHOD go_grid1->set_current_cell_via_id
    **      EXPORTING
    ***        IS_ROW_ID    =
    ***        IS_COLUMN_ID =
    **        is_row_no    = es_row_no.
    *   Triggers PAI of the dynpro with the specified ok-code
        CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    *       CLASS LCL_APPLICATION DEFINITION
    CLASS lcl_application DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_event       TYPE string     READ-ONLY,
          md_node_key    TYPE tv_nodekey READ-ONLY.
        CLASS-METHODS:
          handle_node_double_click
            FOR EVENT node_double_click
            OF cl_gui_simple_tree
            IMPORTING node_key,
          handle_expand_no_children
            FOR EVENT expand_no_children
            OF cl_gui_simple_tree
            IMPORTING node_key.
    ENDCLASS.                    "LCL_APPLICATION DEFINITION
    *       CLASS LCL_APPLICATION IMPLEMENTATION
    CLASS lcl_application IMPLEMENTATION.
      METHOD  handle_node_double_click.
        " this method handles the node double click event of the tree
        " control instance
        " show the key of the double clicked node in a dynpro field
        md_event = 'NODE_DOUBLE_CLICK'.
        md_node_key = node_key.
        " Trigger PAI and set ok-code = 'DETAIL'
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'DETAIL'
    *      IMPORTING
    *        rc       =
        MESSAGE md_node_key TYPE 'I'.
      ENDMETHOD.                    "HANDLE_NODE_DOUBLE_CLICK
      METHOD handle_expand_no_children.
        " this method handles the expand no children event of the tree
        " control instance
        DATA: node_table TYPE node_table_type,
              node TYPE mtreesnode.
        " show the key of the double clicked node in a dynpro field
        md_event = 'EXPAND_NO_CHILDREN'.
        md_node_key = node_key.
        IF node_key = 'Child1'.
    * add two nodes to the tree control (the children of 'Child1')
    * Node with key 'New1'
          CLEAR node.
          node-node_key = c_nodekey-new1.
          node-relatkey = c_nodekey-child1.
          node-relatship = cl_gui_simple_tree=>relat_last_child.
          node-isfolder = ' '.
          node-text = 'New1'(ne1).
          APPEND node TO node_table.
    * Node with key 'New2'
          CLEAR node.
          node-node_key = c_nodekey-new2.
          node-relatkey = c_nodekey-child1.
          node-relatship = cl_gui_simple_tree=>relat_last_child.
          node-n_image = '@10@'.
          node-expander = ' '.
          node-text = 'New2'(ne2).
          APPEND node TO node_table.
          CALL METHOD go_tree->add_nodes
            EXPORTING
              table_structure_name           = 'MTREESNODE'
              node_table                     = node_table
            EXCEPTIONS
              failed                         = 1
              error_in_node_table            = 2
              dp_error                       = 3
              table_structure_name_not_found = 4
              OTHERS                         = 5.
          IF sy-subrc <> 0.
    **        MESSAGE A000.
          ENDIF.
        ENDIF.
      ENDMETHOD.                    "HANDLE_EXPAND_NO_CHILDREN
    ENDCLASS.                    "LCL_APPLICATION IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1 UP TO 100 ROWS
             WHERE  bukrs  = '1000'.
      PERFORM init_controls.
    * Display data
      gs_layout-grid_title = 'Customers: Sales Areas'.
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNVV'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knvv
        EXCEPTIONS
          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.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid1->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
    *   User has pushed button "Display Details"
        WHEN 'DETAIL'.
          MESSAGE gd_okcode TYPE 'I'.
          PERFORM entry_show_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  ENTRY_SHOW_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM entry_show_details .
    * define local data
      DATA:
        ld_row      TYPE i,
        ls_knb1     TYPE knb1.
      IF ( gt_knvv IS INITIAL ).
        SELECT        * FROM  knvv INTO TABLE gt_knvv
        FOR ALL ENTRIES IN gt_knb1
           WHERE  kunnr  = gt_knb1-kunnr.
      ELSE.
        REFRESH: gt_knvv.
      ENDIF.
    ENDFORM.                    " ENTRY_SHOW_DETAILS
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 1
          columns           = 2
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_left.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 2
        RECEIVING
          container = go_cell_right.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent = go_cell_right
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid1.
      PERFORM create_and_init_tree.
    ENDFORM.                    " INIT_CONTROLS
    *&      Form  CREATE_AND_INIT_TREE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_and_init_tree .
      DATA: lt_node_table TYPE node_table_type,
            lt_events TYPE cntl_simple_events,
            ls_event TYPE cntl_simple_event.
    * create a tree control
      CREATE OBJECT go_tree
        EXPORTING
          parent                      = go_cell_left
          node_selection_mode         = cl_gui_simple_tree=>node_sel_mode_single      " single node selection is used
        EXCEPTIONS
          lifetime_error              = 1
          cntl_system_error           = 2
          create_error                = 3
          failed                      = 4
          illegal_node_selection_mode = 5.
      IF sy-subrc <> 0.
    **    MESSAGE a000.
      ENDIF.
    * define the events which will be passed to the backend
      " node double click
      ls_event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
    **  ls_event-appl_event = 'X'. " process PAI if event occurs
      " NOTE: Do NOT register as application event !!!!!
      APPEND ls_event TO lt_events.
      CALL METHOD go_tree->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
    **    MESSAGE a000.
      ENDIF.
      SET HANDLER:
        lcl_application=>handle_node_double_click   FOR go_tree,
        lcl_application=>handle_expand_no_children  FOR go_tree.
    * add some nodes to the tree control
    * NOTE: the tree control does not store data at the backend. If an
    * application wants to access tree data later, it must store the
    * tree data itself.
      PERFORM build_node_table USING lt_node_table.
    * node_table_structure_name     = 'MTREESNODE'
    *   A programmer using the tree control must create a structure in the
    *   dictionary. This structure must include the structure TREEV_NODE
    *   and must contain a character field with the name 'TEXT'.
      CALL METHOD go_tree->add_nodes
        EXPORTING
          table_structure_name           = 'MTREESNODE'
          node_table                     = lt_node_table
        EXCEPTIONS
          failed                         = 1
          error_in_node_table            = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5.
      IF sy-subrc <> 0.
    **    MESSAGE a000.
      ENDIF.
    ENDFORM.                    " CREATE_AND_INIT_TREE
    *&      Form  build_node_table
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_node_table
      USING
        node_table TYPE node_table_type.
      DATA: node LIKE mtreesnode.
    * Build the node table.
    * Caution: The nodes are inserted into the tree according to the order
    * in which they occur in the table. In consequence, a node must not
    * occur in the node table before its parent node.
    * Node with key 'Root'
      node-node_key = c_nodekey-root.
      " Key of the node
      CLEAR node-relatkey.      " Special case: A root node has no parent
      CLEAR node-relatship.     " node.
      node-hidden = ' '.        " The node is visible,
      node-disabled = ' '.      " selectable,
      node-isfolder = 'X'.      " a folder.
      CLEAR node-n_image.       " Folder-/ Leaf-Symbol in state "closed":
      " use default.
      CLEAR node-exp_image.     " Folder-/ Leaf-Symbol in state "open":
      " use default
      CLEAR node-expander.      " see below.
      node-text = 'Root'(roo).
      APPEND node TO node_table.
    * Node with key 'Child1'
      node-node_key = c_nodekey-child1.
      " Key of the node
      " Node is inserted as child of the node with key 'Root'.
      node-relatkey = c_nodekey-root.
      node-relatship = cl_gui_simple_tree=>relat_last_child.
      node-hidden = ' '.
      node-disabled = ' '.
      node-isfolder = 'X'.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      node-expander = 'X'. " The node is marked with a '+', although
      " it has no children. When the user clicks on the
      " + to open the node, the event
      " expand_no_children is fired. The programmer can
      " add the children of the
      " node within the event handler of the
      " expand_no_children event
      " (see method handle_expand_no_children
      " of class lcl_application)
      node-text = 'Child1'(ch1).
      node-style = cl_gui_simple_tree=>style_emphasized_positive.
      APPEND node TO node_table.
    ENDFORM.                    " build_node_table
    Regards
      Uwe

  • How Stop Pop-Up Window: Allow Fullscreen With Keyboard Controls?

    How can I cause the cessation of the pop-up window that asks me, "Allow fullscreen with keyboard controls?" 
    In the last month or two (January- February of 2013), this black, semi-transparent pop-up has appeared every time I go to full screen in the game Battle Pirates on facebook.
    After numerous iterations, this confirmation request has become completely unneccessary and nothing more than an unwelcome annoyance.

    Tom,
    Moderators have the authority and privilege to mark answers as correct, in addition to the original posters. ANY moderator here could have marked it that way.
    The Bug report/Feature Request link is not a "vote" page per say, but a place to submit a request for a feature you'd like to see added or dropped from Flash Player. It's the best way to voice a concern or "wish" for a feature, since the development team reads the reports/requests. Management who'd make the decision to add or remove something won't read about it here. They WILL hear about it from development.

  • How do I get the tag of a selected line in a tree control ?

    I am running LabVIEW 7.1.
    I want to be able to add a parent or sibling to a tree to a selected item in a tree.

    The tag of the selected item is actually the output of the tree control itself. If you create an indicator from the tree control, you will get a duplicate tree control (indicator), but if you wire the output into a string indicator, the tag of the selected item will show up. You can an item to the tree by wiring the tree reference into an invoke node, calling the method "Edit Tree Items: Add Item", and wiring the output of the tree control (which will be the tag of the selected item) into the "Parent Tag" terminal. This method will only let you add a child to an item, you cannot add a parent or sibling. Items cannot have multiple parents, so it wouldn't make sense to add a parent; and to add a sibling for the selected item, you could call the method "Navigate Tree: Get Parent" and pass the tag of the parent into the "Edit Tree Items: Add Item" method.
    Robert Mortensen
    Software Engineer
    National Instruments

  • Control 'ctl00_SPWebPartManager1_g_d4fb972b_26ec_4065_9c89_80b51b384492_gvwikireport' of type 'GridView' must be placed inside a form tag with runat=server.

    Hi,
    I have written code for 'Export To Excel' in the visual web part as below
    //ascx file    
    <table>
        <tr>
            <td>From Date:</td>
            <td><SharePoint:DateTimeControl ID="dtFromDate" runat="server" DateOnly="True" /></td>
        </tr>
        <tr>
            <td>To Date:</td>
            <td><SharePoint:DateTimeControl ID="dtToDate" runat="server" DateOnly="True" TimeOnly="False" /></td>
        </tr>
        <tr>
          <td>Report Type:<asp:DropDownList ID="ddlreporttype" runat="server"><asp:ListItem>Consolidated</asp:ListItem><asp:ListItem>Question Wise</asp:ListItem></asp:DropDownList></td>
            <td>
                <br />               
                <asp:GridView ID="gvwikireport" runat="server">
                </asp:GridView>                   
            </td>
        </tr>   
        <tr>
            <td><asp:Button ID="btnExportToExcel" runat="server" Text="Export To Excel" OnClick="btnExportToExcel_Click"/></td>
        </tr>  
        </table>
    //cs file
    protected void Page_Load(object sender, EventArgs e)
                if (!Page.IsPostBack)
                    BindGridview();
    private void BindGridview()
                DataTable dt = new DataTable();
                dt.Columns.Add("UserId", typeof(Int32));
                dt.Columns.Add("UserName", typeof(string));
                dt.Columns.Add("Education", typeof(string));
                dt.Columns.Add("Location", typeof(string));            
                dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
                dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
                dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
                dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
                dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
                dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
                gvwikireport.DataSource = dt;
                gvwikireport.DataBind();
    protected void btnExportToExcel_Click(object sender, EventArgs e)
                Page.Response.ClearContent();
                Page.Response.Buffer = true;
                Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
                Page.Response.ContentType = "application/ms-excel";
                StringWriter sw = new StringWriter();
                HtmlTextWriter htw = new HtmlTextWriter(sw);
                gvwikireport.AllowPaging = false;
                BindGridview();
                //Change the Header Row back to white color
                gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
                //Applying stlye to gridview header cells
                for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
                    gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
                gvwikireport.RenderControl(htw);
                Page.Response.Write(sw.ToString());
                Page.Response.End();            
    But after clicking the 'Export To Excel' button i am getting the below error
    Control 'ctl00_SPWebPartManager1_g_d4fb972b_26ec_4065_9c89_80b51b384492_gvwikireport' of type 'GridView' must be placed inside a form tag with runat=server.
    In case if i am modifying the code as below I am getting error as 'page can have only one server tag'.
    <form id="frmgrdview" runat="server">
     <asp:GridView ID="gvwikireport" runat="server">
                 </asp:GridView></form>
    So please share your ideas/thoughts on the same.
    Regards,
    Sudheer 
    Thanks & Regards, Sudheer

    Hi,
    According to your post, my understanding is that you fail to export to excel.
    I create a demo as below, it works well.
    <table>
    <tr>
    <td>
    <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
    </td>
    <td>
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>
    <asp:GridView ID="gvwikireport" runat="server">
    </asp:GridView>
    </td>
    <td>
    <br />
    <asp:Button ID="btnExportToExcel" runat="server"
    onclick="btnExportToExcel_Click" Text="Export to excel" />
    </td>
    </tr>
    </table>
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Data;
    using System.IO;
    namespace Export_to_Excel.VisualWebPart1
    public partial class VisualWebPart1UserControl : UserControl
    protected void Page_Load(object sender, EventArgs e)
    if (!Page.IsPostBack)
    BindGridview();
    private void BindGridview()
    DataTable dt = new DataTable();
    dt.Columns.Add("UserId", typeof(Int32));
    dt.Columns.Add("UserName", typeof(string));
    dt.Columns.Add("Education", typeof(string));
    dt.Columns.Add("Location", typeof(string));
    dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
    dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
    dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
    dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
    dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
    dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
    gvwikireport.DataSource = dt;
    gvwikireport.DataBind();
    protected void btnExportToExcel_Click(object sender, EventArgs e)
    Page.Response.ClearContent();
    Page.Response.Buffer = true;
    Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
    Page.Response.ContentType = "application/Excel";
    StringWriter sw = new StringWriter();
    HtmlTextWriter htw = new HtmlTextWriter(sw);
    gvwikireport.AllowPaging = false;
    BindGridview();
    //Change the Header Row back to white color
    gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
    //Applying stlye to gridview header cells
    for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
    gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
    gvwikireport.RenderControl(htw);
    Page.Response.Write(sw.ToString());
    Page.Response.End();
    The result is as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Report with Dynamic tree control

    I have a report with a TREE CONTROL.
    <p>
    A Tree is referenced to: CL_GUI_ALV_TREE_SIMPLE and is located on the left side of the screen.
    <p>
    See diagram below.  The Tree has MULTI-LEVEL nodes and the user can click on any of the nodes which will
    trigger a report (rellevant for that node) to appear in the REPORT container.
    <p>
    Everythign is working fine. 
    <p>
    I now have a requirement to add a TREE ON/OFF functionality.  I have added this by 'Freeing' TREE
    container and by initializing when the user Turns ON the TREE.  It is working fine, HOWEVER, when
    it initilizes the TREE it is COLLAPSED and obviously does not point to the NODE that was clicked.
    <p>
    My goal is to retain the value of the NODE that was pressed and EXPAND the tree to that node and
    highlight it...  Please note that I have MULTI-LEVEL nodes and the user can double click on NODES
    and ITEMS. 
    <p>
    I tried using GET_SELECTED_NODES, but it only works if the user selects the LOWEST level node/item.
    <p>
    Any advise will be appreciated.
    <p>
    Also, as an alternative, I was thinking of resizing TREE container to WIDTH of 1 when the user PRESSES
    TREE OFF and resizing back to width 200 when the user presses TREE ON.  I could not find any methods
    that would work with CL_GUI_DOCKING_CONTAINER. 
    Please help! Thank you in advance.
    <br>
    <br>
    <img src="http://img237.imageshack.us/img237/6684/bdccz3.jpg" border="0"/></a>
    <p>
    <p>

    I have a report with a TREE CONTROL.
    <p>
    A Tree is referenced to: CL_GUI_ALV_TREE_SIMPLE and is located on the left side of the screen.
    <p>
    See diagram below.  The Tree has MULTI-LEVEL nodes and the user can click on any of the nodes which will
    trigger a report (rellevant for that node) to appear in the REPORT container.
    <p>
    Everythign is working fine. 
    <p>
    I now have a requirement to add a TREE ON/OFF functionality.  I have added this by 'Freeing' TREE
    container and by initializing when the user Turns ON the TREE.  It is working fine, HOWEVER, when
    it initilizes the TREE it is COLLAPSED and obviously does not point to the NODE that was clicked.
    <p>
    My goal is to retain the value of the NODE that was pressed and EXPAND the tree to that node and
    highlight it...  Please note that I have MULTI-LEVEL nodes and the user can double click on NODES
    and ITEMS. 
    <p>
    I tried using GET_SELECTED_NODES, but it only works if the user selects the LOWEST level node/item.
    <p>
    Any advise will be appreciated.
    <p>
    Also, as an alternative, I was thinking of resizing TREE container to WIDTH of 1 when the user PRESSES
    TREE OFF and resizing back to width 200 when the user presses TREE ON.  I could not find any methods
    that would work with CL_GUI_DOCKING_CONTAINER. 
    Please help! Thank you in advance.
    <br>
    <br>
    <img src="http://img237.imageshack.us/img237/6684/bdccz3.jpg" border="0"/></a>
    <p>
    <p>

  • TRIAL BALANCE WITH  ALV TREE CONTROL

    Hi Friends,
    My manager wants to see trial balance with cost centers like ALV tree control display.
    Does SAP have any Std trial balance report which can show cost centers also for accounts and activities within those cost centers.
    Please help.
    Thanks

    Nelow message will appear and not possible technically
    Output option ALV Tree Control: Parameter Scaling set to 0/0
    Message no. FR098
    Diagnosis
    You selected output option ALV Tree Control. For technical reasons, only  the value 0/0 is possible for the parameter Scaling.
    System Response
    Parameter Scaling set to the value 0/0.
    Procedure
    If you want to compare the program output for output options ALV Tree Control and Classical list, you have to also set the parameter Scaling  to '0/0' when running the program with output option Classical list.

  • Tree control with Nodes in ALV

    Hi ABAP Gurus,
    I am trying to create tree control with nodes in ALV. I have referred to standard BCALV_TREE* programs but new to OO programming. Not sure as to how I can display my internal table data than the SFLIGHT information in these programs. Can you please let me know how this can be done or if I can use any ALV function modules for the node display.
    thanks,
    Chaitanya

    Maybe you could use this.  Call this VI from a Value Change event of the tree.
    Attachments:
    Check_Tree_Items.vi ‏28 KB

  • Scaling in F.01 with ALV Tree Control

    Hi Experts,
    Is there any possibility of generating the financial statements in F.01 in ALV tree control with amount scaled to 3 or 5 zero's. When i try to use ALV with scaling, the scaling is reset to 0
    Thanks in Advance

    Nelow message will appear and not possible technically
    Output option ALV Tree Control: Parameter Scaling set to 0/0
    Message no. FR098
    Diagnosis
    You selected output option ALV Tree Control. For technical reasons, only  the value 0/0 is possible for the parameter Scaling.
    System Response
    Parameter Scaling set to the value 0/0.
    Procedure
    If you want to compare the program output for output options ALV Tree Control and Classical list, you have to also set the parameter Scaling  to '0/0' when running the program with output option Classical list.

  • Lasso tool control point with delete keyboard shortcut in PS CC

    Hello,
    I can not remove lasso tool control point with delete keyboard shortcut in PS cc. please help

    it's a bug, view this thread
    http://forums.adobe.com/message/6027062#6027062

Maybe you are looking for

  • Is there a way that I can order online and have it arrive at a set date and time?

    Hello there Apple community, I am looking at buying an iPod Touch 5 gen but I'm not sure if I will be at home when it arrives. Is there a way for me to set it to arrive at a time like 4:30 Tuesday? And also, does apple deliver on labour day? This Mon

  • Scroll Pane content doesn't work

    ok, so i've got a movie with a scrollpane (god these things are a hassle) on the stage. the movie tells the scrollpage to load content from an outside swf called testes.swf (short for testimonials). in testes.swf, there are a series of invisable butt

  • Address book list not in a group

    I have all my contacts syncing through iCloud from the iMac, iPhone and iPad. I have a group called iPhone. This contains the main contacts I use on the iPhone. It's easy to see the contacts in the iPhone group and remove the ones I no longer need in

  • Spotlight search for telephon numbers

    Hello, I am using the search field inside the addressbook.app to type in a telephon number of an existing contact. Unfortunately no results are shown for contacts which having the number. Ist it possible to search for telephon numbers of my contacts

  • CS 8.0 Crash @Startup Mac

    Know it's old, but have been using Photoshop CS 8.0 on office Mac Pro and home iMac for years with no problems. OSX is 10.5.8 Leopard. Still works fine on Mac Pro, but has just started crashing at startup on iMac for no apparent reason. Graphic layou