iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have a dynamically created WebCombo. The user is able to select an entry in the drop-down list, but if the drop-down is opened a second time, the SelectRow property throws XmlException "Root element is missing",
I've distilled the problem into the attached ASP.NET code behind. It needs a page with PlaceHolder1 to add WebCombo2 to. When you run it, there's no problem selecting an entry the first time, but if you open the drop-down a second time WebCombo2.SelectedRow throws the exception.
Hi Robert,
I have replicate your issue.
WebCombo's behavior will render when you click DropDownList. So you can't use those code before DropDownList clicked. If you want to get a value which you selected, why don't you use :
WebCombo2.Value;
or you have another scenario ?
I can replicate your issue in here. Unfortunately, you couldn't use the code to select row in PageLoad event. It will return an error because the rows element have not been created yet. The element would be created when you click on DropDown or when the ResultBox popped up.
Is there anything that you need to achieve with the current code? If you only want to set the value, you can simply to use WebCombo2.Value directly.
Hope this helps you Robert.
Riendy
Hi Riendy,
I thought my sample was attached as a file, but I see that in fact it's not - apologies! Here it is. This is the code behind for a page that includes PlaceHolder1.
using System;using System.Data;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;public partial class cs_WebCombo_ResultBoxWorked : System.Web.UI.Page{ ISNet.WebUI.WebCombo.WebCombo WebCombo2; protected void Page_Load(object sender, EventArgs e) { WebCombo2 = new ISNet.WebUI.WebCombo.WebCombo(); PlaceHolder1.Controls.Add(WebCombo2); WebCombo2.InitializeDataSource += OnInitializeDataSource; if (!IsPostBack) { WebCombo2.DataTextField = "FirstColumn"; WebCombo2.DataValueField = "SecondColumn"; WebCombo2.AllowAutoPostback = true; WebCombo2.AllowAutoDataCaching = true; WebCombo2.UseDefaultStyle = true; } var r = WebCombo2.SelectedRow; // this throws XmlException "Root element is missing" on the second drop-down } private void OnInitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs eOriginal) { DataTable dt = new DataTable(); dt.TableName = "TestData"; dt.Columns.Add("FirstColumn", typeof(string)); dt.Columns.Add("SecondColumn", typeof(string)); dt.Rows.Add("one1", "one2"); dt.Rows.Add("two1", "two2"); eOriginal.DataSource = dt; }}
Thanks for your explanation, Riendy. This is in some code that I have inherited using the Name property of SelectedRow, but I'm sure I can manage without it and use just Text and Value.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname