IT Community - Software Programming, Web Development and Technical Support

How to get the index value of the dropdown from the dropdownlist item

This is a discussion on How to get the index value of the dropdown from the dropdownlist item within the C# Programming forums, part of the Software Development category; This will be useful if we were given with one of the dropdown list item and we were asked to ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-12-2007, 12:14 PM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up How to get the index value of the dropdown from the dropdownlist item

This will be useful if we were given with one of the dropdown list item and we were asked to make the given item as the selected content of the dropdownlist.In this case,we will find the index of the item and then bind that index with the dropdown.In this way,we will be able to make the given text as the selected item of the dropdown list.

DropDownList.SelectedIndex=DropDownList.Items.Inde xOf(DropDownList.Items.FindByText(string));
DropDownList.Databind();
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create dropdownlist at runtime shaalini ASP and ASP.NET Programming 1 02-14-2008 08:16 PM
GridView Item Tempalte Problem shaalini C# Programming 0 01-29-2008 09:11 PM
List of EXIF metadata properties item name and its proprety ID values oxygen C# Programming 1 12-24-2007 02:30 AM
Problem in my DropDownList SelectedIndexChanged. S.Vinothkumar ASP and ASP.NET Programming 2 10-11-2007 11:47 PM
Is it possible to select more than single item in dropdown use Asp.net kingmaker ASP and ASP.NET Programming 4 08-03-2007 09:09 AM


All times are GMT -7. The time now is 01:27 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0