0

Dear all .Netters,

I get problem with these controls, DropDownList, CheckBoxList, RadioButtonList.
Sometimes, i add item into those controls manually.
Example :
DropDownList1.Items.Add ("JAKARTA")
DropDownList1.Items.Add ("LONDON")
DropDownList1.Items.Add ("BOMBAY")
DropDownList1.Items.Add ("BEIJING")

If i use this property, DropDownList1.SelectedValue, it returns "JAKARTA",

If we bind it using DataReader, we find these properties DataTextField and DataValueField.
So, in DropDownList, the Item is Jakarta,London,Bombay,Beijing and the value is JKT,LDN,BOM,BEJ.
If i use this property, DropDownList1.SelectedValue, it returns "JKT".

My question is how to add value into DropDownList manually ?

Regards,

Kusno

2
Contributors
2
Replies
5
Views
10 Years
Discussion Span
Last Post by Kusno
0

Hope I understand your question right. You can manually add list items like this:

YourDropDownList.Items.Add(new ListItem("JAKARTA", "JKT"));
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.