Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Please help me on this.. (beginners headache)

 

im working on a c#.net project and getting a hard time figuring this out.

 

My mainForm has 1 comboBox and 1 Textbox, when the mainForm loads, the items on the comboBox is added programmatically from XML file particularly from all the name tags (see XML file below), i want to display the content of the description tag to the textbox, for example if in the combobox johnny is selected, the description for johnny will display on textbox, same for mary.

 

Hope you can help me with sample codes. Thank you..

 

my XML file is just like this:

 

<?xml version="1.0" ?>

<categories>

<category>

<name>Johnny</name>

<description>some text here... eeeee</description>

</category>

<category>

<name>Mary</name>

<description>Talkative... etc.. etc</description>

</category>

</categories>

Posted

As far as I can see you have two real choices here. Once a user selects a person, you re-open the xml file, search for that person and put the contents of the description file into the textbox. Alternatively (and possibly a better solution) is to load the descriptions at the same time as the names and store them in a class.

 

How exactly you do this will depend on how you are currently reading in the xml file.

Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...