Dropdownlist

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Jun 2009
Posts: 415
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 81
Ramesh S Ramesh S is offline Offline
Posting Pro in Training

Re: Dropdownlist

 
0
  #11
Jul 4th, 2009
You can handle this error

  1. drpcompname.SelectedValue = drd.GetValue(0).ToString();

Replace the above statement with the following code

  1. ListItem item = drpcompname.Items.FindByValue(drd.GetValue(0).ToString());
  2. if (item != null)
  3. item.Selected = true;
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC