I give up. I've got a dropdowncombo. I'm trying to refer to the user
selection in the SelectedIndexChanged event. I select one of the last
items in the list. So far I have not been able to successfully access
either the text or the value using an index.
I've been plowing through deja.com to try and find a clue. The closest
I've gotten was someone mentioning in a September post that it didn't
work and you need to cast something. Sorry. I don't know anything about
fishing. I'm using VB for my code-behind.
Any suggestions including code snippets would be helpful.
My current, non-working code is....
If cmbFirst.Items(cmbFirst.SelectedIndex).Value = True Then
gg = cmbFirst.SelectedIndex
setSub(cmbFirst.Items(cmbFirst.Selectedindex).Text(),
cbSub1)
End If
TIA
Sreejith Ram - 31 Oct 2005 20:59 GMT
1) The Selected Value and text is available using
cmbFirst.SelectedItem.Value & cmbFirst.SelectedItem.Text
2) One common mistake is, data binding on every post back. You may want to
make sure whether your data binding code is being called only the first time
page loaded.
code should be like below
if(!Page.IsPostBack())
{
\\code to databind cmbFirst
}
> I give up. I've got a dropdowncombo. I'm trying to refer to the user
> selection in the SelectedIndexChanged event. I select one of the last
[quoted text clipped - 17 lines]
>
> TIA