473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C# XML ListBox

EinToR
20
I'm trying to make a series of listboxes that filter the next listbox.

Ex.:
Listbox01: Toyota, Hundai
Listbox02 (Toyota selected): Supra, Corola
Listbox03: (Supra selected): Red, Black

The DataSource is an XML file simnilar to this:

Expand|Select|Wrap|Line Numbers
  1. <items>
  2.   <item name="Toyota">
  3.     <item name="Supra">
  4.       <item name="Red"></item>
  5.       <item name="Black"></item>
  6.     </item>
  7.     <item name="Corola">
  8.       <item name="Red"></item>
  9.       <item name="Green"></item>
  10.     </item>
  11.   </item>
  12.   <item name="Hundai">
  13.     <item name="Elantra">
  14.       <item name="Black"></item>
  15.       <item name="Blue"></item>
  16.     </item>
  17.   </item>
  18. </items>
  19.  
I know how to create the listboxes but can't figure out how to query the XML to get what I want. It has to be done in C# 2.0...
Jun 10 '08 #1
2 3759
cloud255
427 Expert 256MB
I would make an object which holds a collection of models and also a collection of colours, or if colours are model specific i would put the colour collection in inside te model object.

thus fill the object using the parent/child relationship of the XML. you could make an array of these objects and insert that a as the datasource for your first text box, then fill the other text boxes with the data in the object, not directly from the XML file.

good luck
Jun 24 '08 #2
Frinavale
9,735 Expert Mod 8TB
I'm not sure if you are developing ASP.NET or a desktop application. If you are developing an ASP.NET application there is a CascadingDropDown control that CodePlex has made freely available to developers. It's not ListBoxes but I think it would accomplish what you would like to do.

-Frinny
Jun 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP)...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
8
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in...
2
by: collie | last post by:
Hi, I have 2 listboxes. The first gets populated from the db as soon as the page loads. The second listbox get populated based on the user's selection from the first listbox. However,...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
1
by: yamne | last post by:
I have a problem. When I click in edit datagrid button I show two listbox and two button. I use two button to move data between two listbox. My problem is that I can't call the listbox in the...
7
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but...
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
5
by: Academia | last post by:
(If you've seen this in the drawing NG, sorry. I inadvertently sent it there.) I have a listbox populated with Objects. The Class has a String field that ToString returns. I assume that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.