Hi,
I've got a table like this
Cat1 ¦ Item1
Cat1 ¦ Item2
Cat1 ¦ Item3
Cat2 ¦ ItemA
Cat2 ¦ ItemB
I would now like to create a master and a detail dropdownlist, meaning
the master DDL displays "Cat1; Cat2" and if I select "Cat1" for example
the detail DDl will display "Item1; Item2; Item3".
I tried different ways but nothing really works. Can anyone point me to
a working solution?
Thanks a lot!
Jerome 4 2037
by table, do you mean DataBase table or .NET dataTable
IF its a database,
you can first query the Cat items Grouping by or distinct, to give you the
list like:
Cat1
Cat2
You can then populate the first drop down with that list.
ONce the user picks on of those options, you can then do an additional
DataBase request to get the list of Items filtered by the selected category.
This will take a server postbck though and isn't the best user experience.
You can use Cacheing to speed this up, or javascript
HTH
"Jerome" <su*************@gmail.com> wrote in message
news:eU**************@TK2MSFTNGP10.phx.gbl... Hi,
I've got a table like this
Cat1 ¦ Item1 Cat1 ¦ Item2 Cat1 ¦ Item3 Cat2 ¦ ItemA Cat2 ¦ ItemB
I would now like to create a master and a detail dropdownlist, meaning the master DDL displays "Cat1; Cat2" and if I select "Cat1" for example the detail DDl will display "Item1; Item2; Item3".
I tried different ways but nothing really works. Can anyone point me to a working solution?
Thanks a lot!
Jerome
Hi, thanks for answering.
Yes, I meant a database table.
And populating the first DDL isn't the problem, the second is.
Since the whole list would be way to long for only one DDL, I thought it
would be better to split it in 2. So the user first chooses the category
in the first and then the item in the second. The question now was how
to populate the second DDL based on the first one.
If Postback isn't the best way, what other options do I have and how
would I implement that in my ASP.NET code?
Thanks a lot.
Grant Merwitz wrote: by table, do you mean DataBase table or .NET dataTable
IF its a database, you can first query the Cat items Grouping by or distinct, to give you the list like: Cat1 Cat2
You can then populate the first drop down with that list. ONce the user picks on of those options, you can then do an additional DataBase request to get the list of Items filtered by the selected category.
This will take a server postbck though and isn't the best user experience. You can use Cacheing to speed this up, or javascript
HTH
"Jerome" <su*************@gmail.com> wrote in message news:eU**************@TK2MSFTNGP10.phx.gbl...
Hi,
I've got a table like this
Cat1 ¦ Item1 Cat1 ¦ Item2 Cat1 ¦ Item3 Cat2 ¦ ItemA Cat2 ¦ ItemB
I would now like to create a master and a detail dropdownlist, meaning the master DDL displays "Cat1; Cat2" and if I select "Cat1" for example the detail DDl will display "Item1; Item2; Item3".
I tried different ways but nothing really works. Can anyone point me to a working solution?
Thanks a lot!
Jerome
The easiest most straight forward way would be to do an additional call
causing a post back.
Where for every call you'de be repopulating the same dropdowns contents with
a filetered list based on the first list.
This could be done with the SelectedIndexChanged option on the first
dropdownlist, that will call a method that reads its selected value,
retrieves a filtered list from your DB based on that value, and then binds
this list to the second DropDown.
To avoid doing a post back, you'll either have to user XmlHttp (xml over
http), to bind the list client side, or initially build javascript from your
given dataset to filter the list client side.
This is quite a bit more complex, and although a better user experience, the
first method is much easier to implement and more importantly works
"Jerome" <su*************@gmail.com> wrote in message
news:OW*************@TK2MSFTNGP10.phx.gbl... Hi, thanks for answering.
Yes, I meant a database table. And populating the first DDL isn't the problem, the second is.
Since the whole list would be way to long for only one DDL, I thought it would be better to split it in 2. So the user first chooses the category in the first and then the item in the second. The question now was how to populate the second DDL based on the first one.
If Postback isn't the best way, what other options do I have and how would I implement that in my ASP.NET code?
Thanks a lot.
Grant Merwitz wrote: by table, do you mean DataBase table or .NET dataTable
IF its a database, you can first query the Cat items Grouping by or distinct, to give you the list like: Cat1 Cat2
You can then populate the first drop down with that list. ONce the user picks on of those options, you can then do an additional DataBase request to get the list of Items filtered by the selected category.
This will take a server postbck though and isn't the best user experience. You can use Cacheing to speed this up, or javascript
HTH
"Jerome" <su*************@gmail.com> wrote in message news:eU**************@TK2MSFTNGP10.phx.gbl...
Hi,
I've got a table like this
Cat1 ¦ Item1 Cat1 ¦ Item2 Cat1 ¦ Item3 Cat2 ¦ ItemA Cat2 ¦ ItemB
I would now like to create a master and a detail dropdownlist, meaning the master DDL displays "Cat1; Cat2" and if I select "Cat1" for example the detail DDl will display "Item1; Item2; Item3".
I tried different ways but nothing really works. Can anyone point me to a working solution?
Thanks a lot!
Jerome
search: dependent listbox
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:uO**************@tk2msftngp13.phx.gbl... The easiest most straight forward way would be to do an additional call causing a post back. Where for every call you'de be repopulating the same dropdowns contents with a filetered list based on the first list.
This could be done with the SelectedIndexChanged option on the first dropdownlist, that will call a method that reads its selected value, retrieves a filtered list from your DB based on that value, and then binds this list to the second DropDown.
To avoid doing a post back, you'll either have to user XmlHttp (xml over http), to bind the list client side, or initially build javascript from your given dataset to filter the list client side. This is quite a bit more complex, and although a better user experience, the first method is much easier to implement and more importantly works
"Jerome" <su*************@gmail.com> wrote in message news:OW*************@TK2MSFTNGP10.phx.gbl... Hi, thanks for answering.
Yes, I meant a database table. And populating the first DDL isn't the problem, the second is.
Since the whole list would be way to long for only one DDL, I thought it would be better to split it in 2. So the user first chooses the category in the first and then the item in the second. The question now was how to populate the second DDL based on the first one.
If Postback isn't the best way, what other options do I have and how would I implement that in my ASP.NET code?
Thanks a lot.
Grant Merwitz wrote: by table, do you mean DataBase table or .NET dataTable
IF its a database, you can first query the Cat items Grouping by or distinct, to give you the list like: Cat1 Cat2
You can then populate the first drop down with that list. ONce the user picks on of those options, you can then do an additional DataBase request to get the list of Items filtered by the selected category.
This will take a server postbck though and isn't the best user experience. You can use Cacheing to speed this up, or javascript
HTH
"Jerome" <su*************@gmail.com> wrote in message news:eU**************@TK2MSFTNGP10.phx.gbl...
Hi,
I've got a table like this
Cat1 ¦ Item1 Cat1 ¦ Item2 Cat1 ¦ Item3 Cat2 ¦ ItemA Cat2 ¦ ItemB
I would now like to create a master and a detail dropdownlist, meaning the master DDL displays "Cat1; Cat2" and if I select "Cat1" for example the detail DDl will display "Item1; Item2; Item3".
I tried different ways but nothing really works. Can anyone point me to a working solution?
Thanks a lot!
Jerome
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dmitri Shvetsov |
last post by:
Hi,
Did somebody play with SelectionList Control - Mobile Web Forms ?
I found a problem with this control if it runs in a DropDown list mode.
First of all the Selected item sometime is 0,...
|
by: sagdude |
last post by:
I have a master detail datatable and add a relation
DataRelation relation = new DataRelation("PartNoRelation", Dt_Cart.Columns, Tbl_NearestCenters.Columns,false);...
|
by: hlam |
last post by:
Help - Calculating the total of a column in a data grid --
when data grid is part of Master-Detail set-up
I have setup a Master-Detail form using Visual
Studio.Net. A ListBox is the (Master)...
|
by: Sam |
last post by:
Attached I am sending 2 URL's from MSFT ASP.net Quick Start
Tutorial Web Site.
1) Run it URL:
http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetai...
2) View Source URL:...
|
by: Sam |
last post by:
Sorry to post the same post multiple times but the URL Addresses were
not Correct in Earlier Posts.
Here are the correct URL's:
1) Run It URL is here:
...
|
by: Gary200 |
last post by:
Hello All,
I bind two datagrids in a master-detail relationship successfully.
What I want is to set allowNew and allowDelete disabled in both datagrid
using dataview.
The code like this:
...
|
by: zeeshansohail |
last post by:
I am developing a Database in ORACLE.
I have Master/Detail relationship between two tables named as BILL (Master Table) and DETAIL_DETAIL (Detail Table).
Master Table BILL contains product...
|
by: BillG |
last post by:
I am developing a business app using asp.net that will have 2 different
types of forms, a list view of data and then a detail view. The list views
are placed on a content panel in a master page. ...
|
by: Zetten |
last post by:
This is going to be a long one, but hopefully that will make it easier to understand. I know I don't like posts with too little detail when I'm searching for help.
I am creating a form with which...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |