How can i add a file name(the text of the file name) as a child node to existing node in a treeView1 ?

bool exists = false;
TreeNode newNodeParsed = null;
TreeNode rootNode = treeViewMS1.Nodes[0];
TreeNode nextNode = rootNode;
string f = Path.GetFileName(txtUploadFile.Text);
TreeNode subnode = new TreeNode(txtDir.Text);
TreeNode filename = new TreeNode(f);
if (!txtDir.Text.Contains("/"))
foreach (TreeNode node in rootNode.Nodes)
if (node.Text == txtDir.Text)
exists = true;
break;
if (exists == true)
subnode.Nodes.Add(f);
else
rootNode.Nodes.Add(subnode);
subnode.Nodes.Add(f);
The rootNode is the root directory in the treeView1
subnode is a node inside the root. For example the subnode name is manuelisback
I'm checking if the subnode exist i want to add the file for example (lightning1.jpg) to be under subnode.
If the subnode is not existing add the subnode to the root and then add the file name lightning1.jpg under the subnode.
But the file name is never added under the subnode:
I added manualy the lightning1.jpg under test.
But the lightning1.jpg also should be added to be under manuelisback. There should be two lightning1.jpg here.
One under manuelisback and one under test. The one under test i added manualy from my ftp server.
But the one i want to be under manuelisback i'm trying to add from my program and it dosen't add it to there.
And when i'm using a breakpoint i see on subnode the text manuelisback and i see on f the text lightning1.jpg

If I understand your question correctly, you might want to try changing:
if (!txtDir.Text.Contains("/"))
foreach (TreeNode node in rootNode.Nodes)
if (node.Text == txtDir.Text)
exists = true;
break;
if (exists == true)
subnode.Nodes.Add(f);
else
rootNode.Nodes.Add(subnode);
subnode.Nodes.Add(f);
to something like:
if (!txtDir.Text.Contains("/"))
foreach (TreeNode node in rootNode.Nodes)
if (node.Text == txtDir.Text)
subnode = node;
exists = true;
break;
if (exists == true)
subnode.Nodes.Add(f);
else
rootNode.Nodes.Add(subnode);
subnode.Nodes.Add(f);
rootNode.Nodes.Add(f);
It would be greatly appreciated if you would mark any helpful entries as helpful and if the entry answers your question, please mark it with the Answer link.

Similar Messages

  • IF_IXML : How can i add encoding with value UTF-8 to the document object??

    Hi
    i want to create a xml file with the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <OpenSearchDescription xmlns="http://...."> 
    </OpenSearchDescription>
    i did this with the if_ixml interface and rendered the content in a file 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml
    <?xml version="1.0"?>
    <OpenSearchDescription xmlns="http://...."> 
    </OpenSearchDescription>
    BUT the document attribut(?) encoding="UTF-8"?> is missing!
    How can i add encoding with value UTF-8 to the document object?? it should look like:
    <?xml version="1.0" encoding="UTF-8"?>
    *here is my coding.
    TYPE-POOLS: ixml.
    CLASS cl_ixml DEFINITION LOAD.
    DATA: lo_ixml           TYPE REF TO if_ixml,
          lo_streamfactory  TYPE REF TO if_ixml_stream_factory,
          lo_document       TYPE REF TO if_ixml_document,
          lo_parent         TYPE REF TO if_ixml_element,
          lo_ostream        TYPE REF TO if_ixml_ostream,
          lo_renderer       TYPE REF TO if_ixml_renderer,
         lv_rc           TYPE i.
    lo_ixml = cl_ixml=>create( ).
    lo_streamfactory = lo_ixml->create_stream_factory( ).
    lo_document = lo_ixml->create_document( ).
    lo_parent = lo_document->create_simple_element( name   = 'OpenSearchDescription'  "root node
                                                    parent = lo_document ).
    lo_parent->set_attribute_ns( name   =  'xmlns'
                                 value  = 'http://....' ).
    *rausrendern in file
    lo_ostream = lo_streamfactory->create_ostream_uri( system_id = 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml' ).
    lo_renderer = lo_ixml->create_renderer( ostream  = lo_ostream
                                            document = lo_document ).
    lv_rc = lo_renderer->render( ).
    Thanks for help
    Britta

    Use the following code:
    set an document encoding
      l_encoding = l_ixml->create_encoding( character_set = 'UTF-8'
                                            byte_order = if_ixml_encoding=>co_none ).
      l_success  = l_ostream->set_encoding( encoding = l_encoding ).
    create a xml renderer
      l_renderer = l_ixml->create_renderer( document = l_doc ostream  = l_ostream ).

  • How can you add a 2nd i Tunes account on the same computer?

    How can you add a 2nd i Tunes account to the same computer?

    I had an application where I spawned (= ran with Start Asynchronous Call) multiple (reentrant) copies of VIs, and would occasionally "lose control" of them.  I needed a way to find all VIs that were running "Top Level" and stop them (so I didn't have to log off from Windows).
    I used the Application Property "All VIs in Memory" to get an array of (wait for it ...) All VIs in Memory.  I took each name, opened a VI reference to it (simply wire the name string in, as the VI is, by definition, "in memory"), looked at its VI Execution State, and if it was Run Top Level, Invoked the FP.Close and Abort VI Methods.  [To prevent the VI that did all this from "committing Suicide", I compared the name string with the current Call Chain, and did nothing if there was a match].
    I think you could adopt this idea to do what you need.
    BS

  • How can I add/change art work to albums where the art work isn't available at iTunes?

    How can I add/change art work to albums where the art work isn't available at iTunes?

    Go to google and search for the artwork.  When you find it, save it to your computer.  Right click the album and select get info.  Drag the image you saved to the empty box for album art.

  • How can I add a new message(custom text message) to the holiday approval em

    How can I add a new message(custom text message) to the holiday approval email-notification sent to the manager?
    TIA

    The answer is 'not very easily', unless the information you want to display is the employee's leave balances. In 12.1.3 Oracle have delivered functionality that allows you to include the leave balances in the approval notifications out-the-box, ie, without customization.
    For any other information you're probably going to have to customize the standard delivered HRSSA workflow. Within this workflow, the Leave of Absence functionality uses the Notify Approver (Embedded) (HR_APPROVER_NTF) notification. The body of this notification is set to the Notify Approver (Embedded) (HR_NTF_EMBEDDED_REGION) attribute. This in turn defaults to:
    JSP:/OA_HTML/OA.jsp?OAFunc=-&HR_EMBEDDED_REGION-&NtfId=-&#NID-
    So essentially you can change the HR_APPROVER_NTF notification. The problem with changing this notification is that it's generic - it's used for all SSHR functions and not just Leave of Absence. That means you have to make other, more substantial, customizations to the workflow to ensure the changes you make only applies to LOA.
    The other option is to personalize the review page (ie, the region referenced in &HR_EMBEDDED_REGION) to include whatever messages you want. But that means they'll appear on the Review page and all LOA approval notifications and that might not be what you want.
    It's usually better to live with what Oracle deliver and find an alternative solution! What's the content of the message you want to include?

  • How can I add a fade or other transitions to the pages of my website?

    How can I add a fade or other transitions to the pages of my website?

    like this :
    http://www.onextrapixel.com/2010/02/23/how-to-use-jquery-to-make-slick-page-transitions/
    Cheer up !

  • How can I add photos to a video without interrupting the sound of the original video?

    In PE11, How can I add photos to a video without interrupting the sound of the original video?

    RLHeflin
    Thanks for getting your details posted. Good job.
    You further explained
    I am simply wanting to “overlay” a new visual element without disturbing the underlying audio.
    A classical way to do a Premiere Elements Overlay is to hold down the Ctrl key of the computer main keyboard and drag the new clip over the area of the one you want to replace on the Timeline. That should not do anything but replace one portion of the video on the Timeline. No change in duration video or audio track if you are dealing with video linked to audio.
    If you hold down the Alt key of the computer main keyboard, I am envising a scenario where you want to add to (not replace) some Timeline content.
    A just in case note, if you have video on Video 1 and 2 and the video in 2 does not have transparent areas in it, then all you will see is the Video 2 content. I believe that Hunt eluded to that concept as a possible technique for what you might be doing.
    Another just in case, if you have not seen the following Adobe documentation on arranging clips, you might be interested in the following link
    http://help.adobe.com/en_US/premiereelements/using/WS9B8F8208-EAE8-4b49-A79B-9479B46A8981. html
    Please update us on your progress when you get a chance.
    Thank you.
    ATR

  • How can I add multiple contacts to a text message on a droid bionic

    How can I add multiple contacts to a text message on a droid bionic?

    DH
    I was thinking that if he wanted to create multiple keyframes he might be creating a repeated effect rather than manipulating values that are shot specific - like creating an oscillation or some repeated step effect.  If he was creating keyframes specific to his content he'd probably not look for a way to do it "quickly" since each keyframe would require manipulation of specific values. 
    So my thought was to generate the series of keyframes on a dummy clip created for this specific purpose, copy the clip, paste attributes (maybe turn off "Scale Attribute Times") and add bunches of keyframes at once. 
    Still, you're right, it's tough to divine the intent of someone very new to FCP.  His question could be based on a misunderstanding about the use of keyframes.
    P

  • How can I add an information (including pic, text and button) area in the menu?

    The picture below is captured from on video in Adobe Muse official website. How can I add an area just like the picture shows? I mean the three sleeping bags, texts below and the learn more button.
    Thank you.
    (from http://tv.adobe.com/watch/creative-cloud-for-design/adobe-muse-november-2013-hide-menu-nav igation-on-rollout/)

    This tutorial <http://helpx.adobe.com/muse/tutorials/widgets.html> has a section titled "Hiding Composition widgets on rollout to create submenus" which covers how to use a Composition widget for this purpose.

  • How can I add more options of alternate languages to the "Spec Name" translations?

    The options should appear on a GSM specification when I click on the little globe besides Spec Name, ShortName, Description, and other fields. But I cannot find where to configure that list of languages so that I can add the ones I need for proactive translations.

    You can definitely add more languages.   
    1. Check out the configuration guide: Multi-Language Support for Proactive Translations section.   It will tell you how to activate them in the database. 
    2. Once activated, you will need to assign them to the users that can add translations.  You do this in UGM on the user profile.
    3.  Once languages have been added to the user, the user will see the language options in the proactive language popup.   
    Hope this helps.  Let me know if you have any further questions.
    Kelly
    Just as a reference, in addition to our National Language Support packs we support the following languages for proactive translations:
    Spanish
    Portuguese
    Italian
    German
    Dutch
    Polish
    SpanishMexico
    SpanishCostaRica
    SpanishVenezuela
    Japanese
    Indonesian
    Thai
    Russian
    Finish
    FrenchBelgium
    DutchBelgium
    Danish
    Swedish
    Norwegian
    Czech
    Slovak
    GermanGermany
    GermanSwitzerland
    GermanAustria
    Catalan

  • How can I add a header to a text file without mapping? [Using only ID]

    Hi Experts,
    I am doing a scenario in which I want to add a dynamic header to a text file, due to the complications related to the structure, I dont want to create a message type, data type etc so I cant use mapping.
    I want to do all the manipuations in Integration Directory itself.
    Can you all please help me out in this?
    Thanks in advance
    Thomas

    Hi  Experts,
    I am new to XI, so only elaborate answers would help me
    This is the specific requirement i want;
    There is a 'source text file' which is a collection of 1000+ records, I want to make a 'target file' which is a combination of 2 fields, one field will be the dynamically generated name [for the target file] and the other field will be the whole 'source file' content.
    From the last response for my question, I understand the dynamic file generation part can be done using java mapping.
    Is there anyway by which I can get in the whole content of the source file into a field in the target file?
    Thanks in Advance
    Thomas

  • How can i add a dynamic header value in to the pdf

    I am using a AssemblerService (Invoke DDX) to modify a Pdf file. How can i enter a dynamic value into the header using ddx ?
    DDX used
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
        <PDF result="Out1">       
            <PDF source="Doc2">
                <Header>
                    <Right>
                        <StyledText>
                            <p>"here i need to add a dynamic data from the process"</p>
                        </StyledText>
                    </Right>
                </Header>
            </PDF>
        </PDF>
    </DDX>
    Thank You.

    Insertion Point is a placeholder Object which is used to dynamically replace while assembling. Search through the assmber guide to get any hints.
    Nith

  • How can I add new artwork like backgrounds & graphics, to the content list??

    I would like to add some of the images that i have created to the list of backgrounds, graphics etc under the Content-> Artwork lists.
    How can i do this?

    The effects tab contains special filters and smart objects, so you can’t simply add a jpeg. You need an image, an XML file and a thumbnail. It’s probably easier to keep your artwork in a separate folder and then when you want to add a background to an open image click File à Place
    Then navigate to your background and click Place. That will automatically open as a smart object on a separate layer and you can easily scale it to size or use blend modes/opacity, without loss of quality.

  • How can I add a watermark via JavaScript that includes the current datestamp?

    Part of my daily work process here is to scan in a huge stack of inbound mail. I then OCR the scans, delete the blank pages, and add a watermark. I've got a batch process set up for the first two steps, but I can't make a watermark for the datestamp itself and need to do so via JavaScript, but I have a luddite-level understanding of it.
    As of right now, these are my settings I'm using to add the datestamp:
    What I want to do is run a script to do the same thing and insert the current date where I have mm-dd-yy currently, but I don't have the first clue of where to start. Any help you could offer would be hugely appreciated

    You can use the doc.addWatermarkFromText() method as a JavaScript step in an Action.
    for example
    var dt = new Date();
    var stoday = (dt.getMonth() + 1) + '-' + dt.getDate() + '-' + dt.getFullYear();
    this.addWatermarkFromText({
    cText: "Deposit\r" + stoday,
    nTextAlign: app.constants.align.right,
    nHorizAlign: app.constants.align.right,
    nVertAlign: app.constants.align.top,
    nHorizValue: -72, nVertValue: -72
    See the SDK Help files for information on what all the parameters do.

  • How can I add Internet browser back/forward buttons to the main toolbar?

    The developper of the software I'm testing manages to open
    web-pages in a window within our software. We find this a great
    feature, although it has one downside: no back/forward buttons the
    users have gotten used to thru standard Internet browsers.
    Is there any way to add these classic Internet browsing
    buttons to the main toolbar of a WebHelp output? I've noticed them
    on some other outputs (HTML-help if I'm not mistaken).
    I've noticed some similar topics in this forum, but the seem
    to discuss the browsing sequence buttons, which we find less
    usefull.
    Thanks for looking into this!
    Greetings,
    Olivier

    Hi Olivier
    Take a look at my Skinny on Skins file. There are
    instructions inside on how to accomplish this.
    Cheers... Rick

  • How can I add lyrics to media (mp3, wma, etc.) files?

    Is there any possibility to add lyrics in media files (mp3, wma, etc.) in Windows 7? I didn't get it

    For various reasons, that feature was intentionally removed from WMP12 for Win7.
    Please, please note that tags can still be edited from within Windows Explorer; however, the 'lyrics' feature was removed there.
    See zachd's responses in this thread:
    WMP 12 - Where is the Advanced Tag Editor?
    There, you'll see the reasons that ATE was removed from Media Player, as well as why 'lyrics' went away.
    HTH,
    Chris[If this post helps to resolve your issue, please click the "Mark as Answer" or "Helpful" button at the top of this message. By marking a post as Answered, or Helpful you help others find the answer faster.]

Maybe you are looking for

  • Connection pooling oc4j

    hi guys, I have a deployed application in OC4J (oracle 10g). My JSP needs connection pooling to the DB connection . right now i am uisng normal DB connection, which is not feasible for long term process. I had seen some of the mails/step by step proc

  • Invoice mailing to vendor

    Hi, I have to mail the invoices automatically to vendors. I already configured the SMTP node with SCOT transaction and scheduled the SMTP job.I have also assigned to vendor the email address. I create the vendor invoice with transaction F-43 and when

  • Workshop 3.2 and kodo enhancer

    I am trying to use Workshop Studio 3.2 with Kodo 4.0.1 but I can make to run even JPA tutorial. It is said that WS integrates all build steps including Kodo enhancer. But I am receiving the error: <b><i>kodo.persistence.ArgumentException: The type "c

  • How to setup a Desaturation Tween

    Hi just a quick question, i have a function to swap depths and tween the _alpha property of some movie clips, ---=> Thanx kglad <=--- but i was wondering if theres a way to change the color property without filters?? im especially interested in the S

  • Leopard installation password loop

    I have attempted to install Leopard on my MacBookPro, but after installation get in the password/username loop referred to elsewhere (http://support.apple.com/kb/HT1710). Advice elsewhere on this site says to archive and install, but I don't see that