Posted By

tomaszsimon on 03/16/10


Tagged

list active drop down item DDL


Versions (?)

Setting active item in dropdownlist


 / Published in: C#
 

  1. ddlSizeGuide.DataBind();
  2. string sizeGuideId = dtbProductDeb.Rows[0]["sizeGuideId"].ToString();
  3. ListItem liSizeGuide = ddlSizeGuide.Items.FindByValue(sizeGuideId);
  4. int indexOfDD = ddlSizeGuide.Items.IndexOf(liSizeGuide);
  5. ddlSizeGuide.SelectedIndex = indexOfDD;

Report this snippet  

You need to login to post a comment.