problem with ListItemCollection
Hi All,
i have declared and instance of ListItemCollection and fill it like follows:
Function GetList() As ListItemCollection
Dim lstcol As New ListItemCollection()
lstcol.Add(New ListItem("1st", "2342322"))
lstcol.Add(New ListItem("2nd", "1233434"))
lstcol.Add(New ListItem("3rd", "5464556"))
Return lstcol
End Function
but when attach this collection list to dropdownlist control and getting the value for control selected item i found The value equal to the text displayed!!!
and this code used to display selected item(text,value)
txt1.Text = DropDownList1.SelectedItem.Text.ToString
txt2.Text = DropDownList1.SelectedItem.Value.ToString
Any comment
Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
|