(prefixes) (prefix Title="Mr" /) (prefix Title="Mrs" /) (prefix Title="Miss" /) (prefix Title="Ms" /) (prefix Title="Prof" /) (prefix Title="Capt" /) (prefix Title="Dr" /) (prefix Title="Rev" /) (/prefixes)I also have another xml for states where I need the Two letter ID as well.
(states) (state Name="Alabama" ID="AL" /) (state Name="Alaska" ID="AK" /) (state Name="Arizona" ID="AZ" /) (state Name="Arkansa" ID="AR" /) (state Name="California" ID="CA" /)I have tried seperating the Name and ID as different nodes as well
(states) (state) (Name)Alabama(/Name) (ID)AL(/ID) (/state) (/states)One of my attempts to bind this to a combo box was in asp such as this
(asp:XmlDataSource ID="xmlPrefixes" runat="server" DataFile="~/Xml/Prefixes.xml" XPath="prefixes/prefix" /) (mm:mmRADComboBox ID="cboNamePrefix" runat="server" DataSourceID="xmlPrefixes" DataTextField="Title" DataValueField="Title" Width="60px" /)Couldn't get this to work so I resorted to code and tried this:
XmlDocument doc = new XmlDocument(); doc.Load(Server.MapPath("/Xml/States.xml")); XmlNodeList states = doc.SelectNodes("//state/Name"); for (int i = 0; i < states.Count; i++) { this.cboState.Items.Add(new Telerik.Web.UI.RadComboBoxItem(states[i].InnerText, states[i].InnerText)); }In code the xml document loads up just fine, but navigating the nodes is the problem