|
-
Jun 12th, 2005, 05:38 AM
#1
Thread Starter
New Member
DropDownList
hi
i have 2 DropDownList :
DDLCategory: the Category to sale
DDLItem: the items that belonging to this Category
whan i select item from DDLCategory - i want that all the items that belonging to this Category will be in the DDLItem
i use :
SelectedIndex, SelectedItem...AND SO ON...AND always i get the first item from DDLCategory
what sohld i need to write?
thanks
-
Jun 13th, 2005, 02:31 AM
#2
Member
Re: DropDownList
SelectedIndex\Value\Item will always return the first selected item in the list.
But then again a DropDownList will only allow you to select one item at a time. If you want to be able to select more than one option at a time then you need to use a List control.
If your choice of control is correct then you need to do the following:
1) Set the AutoPostBack property of the DDLCategory control to true.
2) Write a SelectedIndexChanged event handler for DDLCategory. In this hendler write code to clear the items in DDLItem control and populate it with the list of items for the selected category.
3) Populate the DDLItem control with the items for the default Category in the page load event.
~Nikhil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|