473,382 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Populate .net dropdown

I have 2 tables. One is country and holds a list of countries and the other
is region which holds a list of states/provinces/countys relating to that
country.

How do I populate a combo so that it is indented.

e.g

USA
-Florida
-California
-Utah
Canada
-Ontario
-Quebec
England
-Kent
-Northumberland

TIA
Nov 18 '05 #1
1 1124
You get real familiar with the dropdownlist.add() method, because this isn't
something you are going to acheive with the standard way of doing things.
First you have to design a query to return
countries/states/provinces/countys sorted by country, then you have to loop
through them, set some variable to the current country, and then pop either
a Country, or a state/province/county in the dropdownlist using the .add
method. If it is a state/province/county you'll probably need to add
something to the beginning to actually indent it. Then you'll have the
problem of finding out if they selected a country or a
state/province/county.

sounds fun!

"Poppy" <pa**********@NOSPAMthemedialounge.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have 2 tables. One is country and holds a list of countries and the other is region which holds a list of states/provinces/countys relating to that
country.

How do I populate a combo so that it is indented.

e.g

USA
-Florida
-California
-Utah
Canada
-Ontario
-Quebec
England
-Kent
-Northumberland

TIA

Nov 18 '05 #2

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

Similar topics

20
by: Dannyboyo | last post by:
I have what I hope is a simple request. I can't really code in javascript, but I am pretty good at cusomizing it with slight modifications. I code in ASP and HTML. I am trying to capture customer...
1
by: jzhang29 | last post by:
I have a JSP page and it contains a dropdown list called Office. What I try to do is: When I select different office from this list, the information of office (address, phone,etc) will be...
0
by: Nithin | last post by:
My code as an txt attachment. I have 2 drop down list boxes that on selection populate text boxes from my database table. I am able to display the correct values in these text boxes. I have 2...
0
by: anjupt | last post by:
Hi, Will i able populate data into a listbox on dropdown selection. I have a dropdown with classnames and sections and on the selction of this dropdown i want list of students with respect to...
0
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
1
by: Dave | last post by:
I'm working with an ASP.Net web page that's using C#. I'm trying to populate a Dropdown with the File Names that reside in an image folder that's in the same project. So far all I've been able to...
11
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and...
1
by: fran7 | last post by:
Hi, Anyone know how to populate a dropdown list with data from database. I have an interface that generates the following code for names in my database. ..asp <%If Trim(rsCard("Author"))<>""...
2
by: FatBear | last post by:
Sorry for cross-posting this to microsoft.public.inetserver.asp.db - I didn't know if that group saw much action. Hi All, I'm very new to ASP and am now working on an existing site that is...
2
by: chinni1 | last post by:
Hii.. I Have 2 dropdowns.The first dropdown contains main products which is from database table1. If we select The one of dropdown value then the 2 second drop down should fill with all sub...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.