I'm using XmlDataSource
as the datasource
for a dropdownlist
.
Now I want to set the SelectedValue
of the drop down when the page initially loads. I have tried the OnDataBound event
of the drop down in which I could see the total items. But setting the SelectedValue
didn't work. InOnDataBinding
event, I couldn't even see the total items probably because the list isn't bound yet?
How can I set the selected index based on a value?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…