473,569 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

easy way to dynamically load dropdown boxes

im dynamically loading dropdown boxes on page.load

like this :
cbo1.Items.Add( "")
cbo1.Items.Add( "OT")
cbo1.Items.Add( "ST")
cbo1.Items.Add( "Ho")
cbo1.Items.Add( "FMLSK")
cbo1.Items.Add( "FMLOI")
cbo1.Items.Add( "FMLPE")
cbo1.Items.Add( "UFMLSK")
cbo1.Items.Add( "UFMLOI")
cbo1.Items.Add( "UFMLPE")
works fine. my only question is. currently i have 32 of these dropdown controls,cbo1 & cbo2 etc.(32 total)
eventually there'll be approx 5 or 10 times that many and they'll need to be populated accordingly.
is there an easier way to do this?
thanks
rik

*************** *************** *************** *************** **********
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 19 '05 #1
1 1191
where is the list of items coming from?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
wrote in message news:%2******** *******@TK2MSFT NGP14.phx.gbl.. .
im dynamically loading dropdown boxes on page.load

like this :
cbo1.Items.Add( "")
cbo1.Items.Add( "OT")
cbo1.Items.Add( "ST")
cbo1.Items.Add( "Ho")
cbo1.Items.Add( "FMLSK")
cbo1.Items.Add( "FMLOI")
cbo1.Items.Add( "FMLPE")
cbo1.Items.Add( "UFMLSK")
cbo1.Items.Add( "UFMLOI")
cbo1.Items.Add( "UFMLPE")
works fine. my only question is. currently i have 32 of these dropdown
controls,cbo1 & cbo2 etc.(32 total)
eventually there'll be approx 5 or 10 times that many and they'll need to
be populated accordingly.
is there an easier way to do this?
thanks
rik

*************** *************** *************** *************** **********
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...

Nov 19 '05 #2

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

Similar topics

1
1535
by: Deepa | last post by:
I am doing an ASP.Net application wherein I have a datagrid which I need to populate dynamically. The grid has 5 rows and two columns. In the 2nd col I need to insert dropdown boxes. I'll have to populate both the cols from the database. The values for the 2 cols come from 2 diff tables. How do I do this? Also in the design mode, do I have...
1
2583
by: MN | last post by:
Greetings to all - I'm having some fits with getting this to work but I'm near the end and I'm hoping this one obstacle is not a huge one to get past. Here's my scenario: I have a page where when someone clicks on a dropdown and selects an item, it will hide 2 other dropdown boxes that are related as the input in those are applicable. ...
7
3250
by: Tim T | last post by:
Hi, I have the need to use dynamically loaded user controls in a webform page. I have the controls loading dynamically, and that part works fine. this is the code used in a webform to dynamically load one of several controls: private void btnCategory_Click(object sender, System.EventArgs e) { Control myControl =...
8
4303
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image button at runtime: //----- Code snippet protected System.Web.UI.WebControls.PlaceHolder ImageHolder; private void Page_Load(object sender,...
2
1531
by: Julia | last post by:
Hi, I have a custom control which render drop down boxes according to XML configuration file I would like to know how do I get the selected items of the drop down boxes should I override LoadViewState and SaveViewState? Thanks in advance
4
2427
by: Kalvin | last post by:
I have seen this question raised, but I cannot find an answer. I have an MDI app, when I load an child form with a combobox being bound in the load event, it won't allow me to set selectedindex = -1. If it isn't an mdi child, then there isn't a problem. I have tried setting it to -1 two times. I have tried setting the selecteditem property...
5
3434
Tann3r
by: Tann3r | last post by:
Apache.v2.2.4, MySQL.v5.0.27, PHP5.2.1 I have a table of projects which has been dynamically created from an SQL query. I have several dropdown boxes which have been populated from other tables within the database and i would like to filter the information shown in the main table dependant upon the items selected in the dropdown list(s). I...
3
2997
by: balurajeev | last post by:
Hii, currently i am working on an apliction(ASP.NET/C#) that creates dynamic html rows which contain six html text boxes and a html dropdowllist. At the time of page load the web page contain six server side text boxes and a serverside drop down list. and a html "Addrow" buton which create client side textboxes and dropdown list dynamichally...
1
1934
by: =?Utf-8?B?c3RldmVuIHNjYWlmZQ==?= | last post by:
Hi I have been banging my head for a few days now with this issue. I have a page that has several update panels everything is working fine except for 1 thing. I am creating a sort of wizard that will build a form that I plan to save to a database On stage 2 I load a usercontrol an unspecified number of times depending on
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.