The ComboBox Control from our UI SDK for ASP.NET AJAX allows users to bind combobox to different types of data sources, like array, array list, DataSource and xml data file. And this online tutorial page will show you how to bind data from array and array list to the combobox at runtime in aspx web application.
One thing that needs to be mentioned here is that although the data source can support both hierarchical and flat structure, the asp.net ComboBox Control is only available with these non-hierarchical data source since combobox items can not have child items.
Following code is the declaration of the web ComboBox objecs. <kettic:PerComboBox runat="server" ID="PerComboBox1">
To successfully bind data from array or arraylist to asp.net combobox, you have to create the Array and ArrayList in the Page_Load event handler. And after you set the DataSource property, you must call the DataBind method for binding created Array and Arraylist to target combobox objects. How to Bind ComboBox to Array using DataBinding
In this section, we will show you how to get data from Array and bind it to target web ComboBox object with sample C# code. string[] array = { "1", "2", "3" };
The image below is attached t show the result of this combobox data binding to Array application. ![]() How to Bind ComboBox to ArrayList using DataBinding
With the asp.net ComboBox Control, it is also easy to bind data from ArrayList to source combobox object using C# code. ArrayList arrayList = new ArrayList();
Similar, we also attach an image to display the result of this combobox data bind to ArrayList project. ![]() Other Related ComboBox Data Binding Tutorials
Apart from the function to bind data from Array or ArratList to combobox, the asp.net ComboBox Control also allows developers to bind combobox to other data types, like: | ![]() ASP.NET AJAX UI Controls ASP.NET AJAX Chart UI Control ASP.NET AJAX Grid UI Control ASP.NET AJAX Barcode UI Control ASP.NET AJAX Button UI Control ASP.NET AJAX Calendar UI Control ASP.NET AJAX NavigationBar UI Control ASP.NET AJAX Captcha UI Control ASP.NET AJAX Color Editor UI Control ASP.NET AJAX ComboBox UI Control OverviewGetting StartedElementsFeatures FilteringValidationAutoCompleteChekBox SupportRender ModesLoad On DemandTemplates Item TemplateHeader and Footer TemplateData Binding ArrayList Data DataSource DataXML DataClient Prpgramming ComboBox EventServer Programming ComboBox EventASP.NET AJAX DataPager UI Control ASP.NET AJAX Dock UI Control ASP.NET AJAX DropDownList UI Control ASP.NET AJAX DropDownTree UI Control ASP.NET AJAX HtmlEditor UI Control ASP.NET AJAX FileManager UI Control ASP.NET AJAX Filter UI Control ASP.NET AJAX Input UI Control ASP.NET AJAX ListBox UI Control ASP.NET AJAX ListView UI Control ASP.NET AJAX ToolBar UI Control ASP.NET AJAX TabControl UI Control ASP.NET AJAX Menu UI Control ASP.NET AJAX ToolTip UI Control |