Adding Items to DropDownListBox
-
Hi All: I have a peculiar Challenge and need a work around.There is a form that my application uses which has a drop down list being populated at run time.And there can be a case when there is no data to populate it. Apart from the data being populated i want the dropdownlist to have the option "Select one by clicking" as the default selected option in this listbox.I have managed to do it by the commands
txt_listbox.items.add
and then selected the option using**txt_listbox.items.findbytext("---").selected=true**
but then the challenge is this option though gets selected is the last item on my dropdown listbox after all the data from the datatbase..But i want it to be the first..How do i do that. If i try adding this entry and then populating from the database the database entries wipe out this entry or i get some nasty errors. Any help is greatly appreciated.. Regards Pradhip.S If a Building is Completed then why do they call it BUILDING ?? -
Hi All: I have a peculiar Challenge and need a work around.There is a form that my application uses which has a drop down list being populated at run time.And there can be a case when there is no data to populate it. Apart from the data being populated i want the dropdownlist to have the option "Select one by clicking" as the default selected option in this listbox.I have managed to do it by the commands
txt_listbox.items.add
and then selected the option using**txt_listbox.items.findbytext("---").selected=true**
but then the challenge is this option though gets selected is the last item on my dropdown listbox after all the data from the datatbase..But i want it to be the first..How do i do that. If i try adding this entry and then populating from the database the database entries wipe out this entry or i get some nasty errors. Any help is greatly appreciated.. Regards Pradhip.S If a Building is Completed then why do they call it BUILDING ??txt_listbox.items.insert(0,"Select one by clicking") txt_listbox.setselected(0,true)
Hopefully that will work.