Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

drop down List

  Asked By: Glenn    Date: Jan 28    Category: Asp.net    Views: 863
  

I need to set a particular item of my drop down list selected after data bind.

i´m trying :

this.DROP_DOWN.tems.FindByValue(mystring).selected = true;

it seems to be ok but the FindByValue Method never finds the item.

here is the code:

this.GetAgencias(this.ObjReserva.AgRetirada.Cidade,this.AGENCIA_RETIRADA,"R");

//this method Load the data from my database and bind to the drop down list

this.AGENCIA_RETIRADA.Items.FindByValue(this.ObjReserva.AgRetirada.LocCode).Selected = true;

and then make it selected.

can anyone help me??

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Della Simpson     Answered On: Jan 28

try this,

this.DROP_DOWN.items.selectedIndex=this.DROP_DOWN.items.IndexOf(this.DROP_DOWN.items.FindByValue(trim(mystring))) . Hope that helps.

 
Didn't find what you were looking for? Find more on drop down List Or get search suggestion and latest updates.




Tagged: