I have a dropdownlist with the days , another with the months and another
with some years . Now i get the date from the database and splt it into the day
month and year like this:
Dim begindag As String = Format(CDate(objSurvey.Survey_Begin), "dd")
Dim beginmaand As String = Format(CDate(objSurvey.Survey_Begin), "MM")
Dim beginjaar As String = Format(CDate(objSurvey.Survey_Begin), "yyyy")
Eg: Date = 10-05-2001 begindag= 10 , beginMaand = 05 beginJaar =2001
Then i want to search my dropdownlists and setthem to the day, month and
year specified like this:
ddlBeginDag.Items.FindByValue(begindag).Selected = True
ddlBeginMaand.Items.FindByValue(beginmaand).Selected = True
ddlBeginJaar.Items.FindByValue(beginjaar).Selected = True
what goes wrong here? I need to know how to set the ddl to the right (exsisting) item
Ps the error = dropdownlists cannot have multiple items selected
So it tries to select multiple items, but i dont understand why
i just want to search the ddl till it finds the value 10 (resp. 05 and 2001) and then set it selected
thanx for the help!
0
Dropdownlist een item geselecteerd zetten
Door
VB6Dummy
, 04 mei 2011 07:18
Geen reacties in dit onderwerp
0 gebruiker(s) lezen dit onderwerp
0 lid(leden), 0 bezoeker(s), 0 anonieme gebruikers