Greetings,
I created a couple of dropdown list. then called a method to retrun a datareader that contains data from the database. I need to populate a form . So my code below suppose to do so, but when using selectedIndex, it works, but when using .SelectedItem.Value does not work.
Any idea why?
| |
Note when populateing inputform from gv via link. Only use selected index to work. Selecting the other will not give the value to the input form. ?
2nd Question, how do I know when to use any of the properties below. Can I stick to only one for instance
.SelectedValue and ignore the rest.
ddlqualification.SelectedItem.Value = dr["qualificationid"].ToString() ;
ddlqualification.SelectedIndex = dr["qualificationid"].ToString() ;
ddlqualification.SelectedValue= dr["qualificationid"].ToString() ;
Please advise,
Thanks
Al

Vinay SinghRank #604 · 4K reputationPosted Apr 6, 2020, 10:52 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Apr 6, 2020, 11:35 PM EDT