Home > ASP.NET, C# > Setting Drop Down Selected Index programmatically.

Setting Drop Down Selected Index programmatically.

What is you need to select the item from the drop down list programmatically where you don’t know on which index it would be. For that simplest way is

ddlData.SelectedIndex=ddlData.Items.IndexOf(ddlData.Items.FindByText("value"));
Happy CodingSmile
 
Advertisements
  1. June 12, 2012 at 9:47 am

    miami heat
    Hey, fantastic post. You normally have terrific content. Entirely agree with every thing you just posted. miami heat

  2. Syed Shoaib Adil
    July 9, 2012 at 12:16 am

    I think u forgot to mention one thing in the POST. its related to javascript…

    • September 5, 2012 at 1:14 am

      Thanks for your concern , Please share that here 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: