473,471 Members | 4,629 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

databind - XmlNodeList to DropDownList

hello,

i am attempting to do some databinding of an XmlNodeList to a
DropDownList. id like to avoid looping thru my nodelist and hoped to do
a simple .DataSource/.DataBind technique.

for simplicity, lets say this is my xml:

<people>
<person name="Joe">[other child nodes w/ innertext]</person>
<person name="Bob">[other child nodes w/ innertext]</person>
<person name="Tim">[other child nodes w/ innertext]</person>
</people>

....and this is my code-behind:

'get person nodes
Dim personNodes As XmlNodeList = xml.SelectNodes("//person")

'bind to list
ddlYear.DataSource = personNodes
'ddlYear.DataTextField = ??
ddlYear.DataBind()
my desired result is a dropdownlist of items w/ text of:

Joe
Bob
Tim

....how does one do this?
thanks!
matt

Nov 19 '05 #1
0 1494

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: xzzy | last post by:
Problem: the following creates an empty dropdownlist it needs to populate the dropdownlist with a list of printers global.aspx.cs++++++++++++++++++++++++++ string l_SQL = "SELECT modRowID,...
3
by: Srinivas | last post by:
Hi, My function returns a datareader object containing only one column of datatype money. In asp.net I want to bind this datareader to a dropdownlist. Can anyone suggest me how to do this with...
0
by: Bryce Budd | last post by:
Hi, I have a webform which has several server controls attached. The entire form is data bound to custom objects. The collection objects are cached using the Cache object. In my use case, I...
2
by: Jim Bancroft | last post by:
Hi everyone, I have a DropDownList I populate as outlined below. This is from my code-behind file: private void Page_Load(object sender, System.EventArgs e) { BindMyData(); DataBind(); }
2
by: Olav Tollefsen | last post by:
I have a Web Form with a DataList. Inside the ItemTemplate, I have a DropDownList control. <asp:DataList ID="ProductDataList" Runat="server"> <ItemTemplate> <asp:DropDownList ID="DropDownList1"...
2
by: Jimmy | last post by:
Hi all I want to databind a dropdownlist in a datagrid: private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here
1
by: John Blair | last post by:
Hi, how do i reset a dropdownlist selectedindex value to a specific value - when the dropdownlist isa in a custom grid header, is data bound, and the main grid has been rebound to its...
0
by: murfu | last post by:
I have a formview that has a dropdownlist bound to a table to populate a list of people. While in edit mode, if a person is not in that list, there is a button that pops up an add requester page...
6
by: Jonathan Wood | last post by:
I have a databound dropdownlist control. Based on some other criteria, I need to specify the selected item in my pages Load event. The problem is that, in my load event, the control does not yet...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.