Hi Ron,
I can understand your frustration, as I ran into this a couple of times as well.
However, if you think about it from an object oriented perspective, it may make sense.
The ListItem class is just that; a simple and
single list item that can be placed in a list control. Each ListItem object is able to determine whether it's currently selected or not, and you can instruct it to become selected by setting its Selected property to true.
However, once you do that, nothing else happens. One ListItem is not aware of other items in the same list, so it doesn't reset the Selected property of the other items in the list.
This is generally a good thing, because the same ListItem class can be reused in other List controls that *do* support multiple selections.
Now, if you look at the DropDownList control, things are a bit different. The DropDownList does know it can only have one item selected at all times. So when you set the SelectedIndex to, say, 4, the List will ensure that for all the other items, the Selected property is set to False. Therefore, the list is in control (no pun intended) and makes sure only one ListItem is selected.
This means that if you try to set the Selected property of a ListItem directly, you need to call
ddList.ClearSelection().
Does this help?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.