Article Options
Recently Viewed
Premium Sponsor
Premium Sponsor

 »  Home  »  Web Development  »  The Low Down on ASP.NET DropDownList Control
 »  Home  »  Web Development  »  ASP.NET  »  The Low Down on ASP.NET DropDownList Control
The Low Down on ASP.NET DropDownList Control
by Guest Author | Published  01/10/2003 | Web Development ASP.NET | Rating:
Guest Author
This author account is for guest publications only, and does not reflect the bio for any particular author. 

View all articles by Guest Author...
The Low Down on ASP.NET DropDownList Control

Guest Author: Roger D. McCook

Introduction

Whenever I see a DropDownList control, my brain says "Yes! That is a ComboBox!"  That's because I've been programming in Visual Basic 6.0 for too long. VB6 has something called a ComboBox. It was given that name because it could be used in different ways. That was way cool but whenever I had to write a help file or explain an application to a customer, I couldn't use the term "ComboBox" without them wrinkling their brow and frowning at me. The "combo" aspect of the control never made sense to users, only programmers. So I started calling it a drop-down list. That made more sense to the customer. No more wrinkled brows. No more frowns. (But sometimes in the middle of the night I would quietly whisper ... "ComboBox! ComboBox!").

My brain is, however, quite wrong in identifying the DropDownList control as a ComboBox. It is not a ComboBox. NOT. It is just a single-line picklist control. Need a picklist? This is your control.  

Properties

Property Name Description
AutoPostBack Boolean. Automatically posts the form if True. Default is False. 
DataMember Identifies the table in a data source to bind to the control.
DataSource Identifies the data source for the items in the list.
DataTextField Identifies the field in the data source to use for the option text.
DataValueField Indicates the field in the data source to use for the option values.
DataTextFormatString Format string for determining how the DataTextField is displayed.
Items Collection of items in the control. 
SelectedIndex Indicates the index number of the selected option.
SelectedItem The selected item (duuh).

Methods

Method Name Description
DataBind Binds the control to its data source. This means the items from the data source are loaded into the controls ListItem collection.
OnSelectedIndexChanged Raises the SelectedIndexChanged event.

Events

Event Name Description
SelectedIndexChanged The event is raised whenever a new option is selected.

How To Get Options Into the DropDownList Control

1. If you are using Visual Studio, drag the DropDownList control from the toolbox onto the web form. Make sure you choose the control from the WebForms tab and not the HTML tab. After positioning the control where you want, resizing it and so on, you can manually enter the items into the list using Visual Studio. Go to the properties dialog for the control. If the properties dialog is not visible, right click on the control and select PROPERTIES from the menu. Find the entry for "Items" and click on the ellipsis button to bring up the ListItem Collection Editor. Click the ADD button on the left side of the editor. On the right side, enter "Georgia" in the text field and "GA" in the value field. Now click ADD again and enter "Florida" in the text field and "FL" in the value field. Click ADD again and enter "Alabama" in the text field and "AL" in the value field. Click the OK button. Now you have a DropDownList control with three list items. The text portion of each item will display the state name. The corresponding value will be the abbreviation of the selected state. 


2. You can access the text and value properties of the selected item in code as follows: 

Dim strVariable as String

'- To access the text portion
strVariable = DropDownList1.SelectedItem.Text

'- To access the value portion 
strVariable = DropDownList1.SelectedItem.Value


3. If you are not using Visual Studio or if you just allergic to drag 'n drop, you can code the above directly following the following syntax: 

<asp:DropDownList id="DropDownList1" runat="server">
    <asp:ListItem Value="GA">Georgia</asp:ListItem>
    <asp:ListItem Value="FL">Florida</asp:ListItem>
    <asp:ListItem Value="AL">Alabama</asp:ListItem>
</asp:DropDownList>


4. You can write code to add your items also. Here is an example of how you might populate the control when the page loads for the first time. Notice, however, that we are only filling in the text portion of each option, not the value portion.  

If Not Page.IsPostBack Then
    DropDownList1.Items.Add("Georgia")
    DropDownList1.Items.Add("Florida")
    DropDownList1.Items.Add("Alabama")
End If


5. You can bind the DropDownList control to an ArrayList. Again, notice that we are not getting the value portion of each option. 

Dim colArrayList as New System.Collections.ArrayList() 

If Not Page.IsPostBack Then
    colArrayList.Add("Georgia")
    colArrayList.Add("Florida")
    colArrayList.Add("Alabama")

    DropDownList1.DataSource = colArrayList
    DropDownList1.DataBind() 
End If


6. The following example shows how to populate the control using a Hashtable. Now we can get both the text and value portions populated. 

Dim myHashTable as new System.Collections.Hashtable() 

myHashTable("GA"= "Georgia"
myHashTable("FL"= "Florida"
myHashTable("AL"= "Alabama"

For each Item in myHashTable
    Dim newListItem as new ListItem()
    newListItem.Text = Item.Value
    newListItem.Value = Item.Key
    DropDownList1.Items.Add(newListItem
Next


7. A SortedList is a collection that stores key/value pairs (like a hashtable) but where the items are automatically sorted according to key/value. Here is an example: 

Dim mySortedList as new System.Collections.SortedList
Dim Item as DictionaryEntry

mySortedList("GA"= "Georgia"
mySortedList("FL"= "Florida"
mySortedList("AL"= "Alabama"

For each Item in mySortedList
    Dim newListItem as new ListItem()
    newListItem.Text = Item.Value
    newListItem.Value = Item.Key
    DropDownList1.Items.Add(newListItem)
Next


8. Here is an example of how you might populate the control from a SQL Server database using a data reader object: 

' Let's assume the connection string is stored in a session variable. 
Dim strConnect as Strng
strConnect = Session("ConnectionString"

' Open the Connection 
Dim Con as new System.Data.SQLClient.SQLConnection(strConnect
Con.Open() 

' SQL Statement
Dim strSQL as String
strSQL = "SELECT State_Name, State_Code FROM TableState ORDER BY State_Name"

' Command, Data Reader  
Dim Com as new System.Data.SQLClient.SQLCommand(strSQLCon
Dim rdr as System.Data.SQLClient.SQLDataReader = Com.ExecuteReader() 

' Populate the Control 
While rdr.Read()
    Dim newListItem as new ListItem() 
    newListItem.Text = rdr.GetString(0)
    newListItem.Value = rdr.GetString(1
    DropDownList1.Items.Add(newListItem
End While
Generated using PrettyCode.Encoder

Conclusion

I certainly didn't exhaust all the possibilities but I think this provides a pretty decent overview of the control, how to use it and how to get data into it. If you have any comments, corrections or other ideas, you can email me at: 

RogerMcCook@hotmail.com

About the Author

Roger D. McCook of McCook Software, Inc., a Georgia Corporation providing IT Consulting and custom computer programming services. Roger can be reached at RogerMcCook@hotmail.com.
Copyright (c) 2002, Roger D. McCook. All rights reserved.

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Article Rating
The average rating is: No-one else has rated this article yet.

Article rating:3.9838056680162 out of 5
 247 people have rated this page
Article Score184234
Comments    Submit Comment

Comment #1  (Posted by tjagi on 01/15/2003)

It's a very good article, thank you very much.
 
Comment #2  (Posted by Chip Johansen on 03/10/2003)

You need to show how to set a specific item as selected to make an otherwise good article complete.
 
Comment #3  (Posted by AaronO on 03/24/2003)

I'm looking for information on how to set the selected after the list is populated. The way I see to do it is based on the Index of the list, but I want to do it based on the Value. That's an important aspect of the dropdownlist.

Thanks
 
Comment #4  (Posted by Manish on 03/28/2003)

Selecting From Drop Down List is Very Bogus.

myDropDown.SelectedIndex = myDropDown.Items.IndexOf(myDropDown.items.findbytext(strCurrentState))
myDropDown.SelectedIndex = myDropDown.Items.IndexOf(myDropDown.items.findbyvalue(strCurrentState))

MicroSoft are really Micro And Soft.

 
Comment #5  (Posted by Manish on 03/28/2003)

Selecting From Drop Down List is Very Bogus.

myDropDown.SelectedIndex = myDropDown.Items.IndexOf(myDropDown.items.findbytext(strCurrentState))
myDropDown.SelectedIndex = myDropDown.Items.IndexOf(myDropDown.items.findbyvalue(strCurrentState))

MicroSoft are really Micro And Soft.

 
Comment #6  (Posted by vicki on 05/26/2003)

This was a great help. Thank you!
 
Comment #7  (Posted by shiju on 05/26/2003)

manish, could you please tell me what is that 'strCurrentState' ? i'm getting an error when i used your code.

this article is really fantastic. thanks
 
Comment #8  (Posted by jackieliao on 05/28/2003)

Excellent! This helps me a lot!
 
Comment #9  (Posted by Darren Voisey on 06/12/2003)

Don't forget you can bind to a HashTable....

(6b)
Dim myHashTable as new System.Collections.Hashtable()

myHashTable("GA") = "Georgia"
myHashTable("FL") = "Florida"
myHashTable("AL") = "Alabama"

DropDownList1.DataSource = myHashTable
DropDownList1.DataTextField = "Value"
DropDownList1.DataValueField = "Key"
DropDownList1.DataBind()


 
Comment #10  (Posted by nico on 06/30/2003)

Need and example with 5 pull down external links and one go button that takes you to the links when you press it. So lets say you have 5 selections in your pull down amazon, msn, cnn, yahoo, and devcity.net. You would select one then hit the go button next to the pulldown and it would take you to that url. Nothing fancy I just need the code for a newbie, uh me.
 
Comment #11  (Posted by Nayan on 08/16/2003)

Gr8 article........very useful to me
 
Comment #12  (Posted by Mike Murray on 12/07/2003)

Is there anyway to get this article in C#???

Thanks
 
Comment #13  (Posted by Hafeez Abdul on 12/10/2003)

This is very useful article, and found all required info @ excellent format
 
Comment #14  (Posted by Anil M on 04/07/2004)

Thanx for this artical i fed up with the selected index,and your article help me to find out the mistake i did.going on with this help.


 
Comment #15  (Posted by ChiefDND on 05/05/2004)

hello,

Thanks for the info, I am also looking to use DataTextFormatString, any details would be helpful.
User should see xxx-xx-xxx-xxxx, is that possible?

Thanks again,

Chiefdnd@hotmail.com
 
Comment #16  (Posted by distey on 07/18/2004)

Hi there..ur article was very informative..but i'm unsure how to bind data to say perhaps a menu? For eg. on the default page, there is a side menu with categories of books (eg technical, marketing..etc) When a user clicks on either one of these options, they should be directed to another page with only the details of the category they've selected..how do i do this? I'm using C# to program, but i'm very new to both C# and ASp.net..pls help..
 
Comment #17  (Posted by Guy on 09/06/2004)

Awesome job of laying out the options - thanks!!
 
Comment #18  (Posted by Owotidefunmi on 09/08/2004)

Can anyone pls help me with selecting items out of a dropdown list after populating it from a DB query? What I have right now only picks the first item in the list even if you select other item.
 
Comment #19  (Posted by Ravi on 09/22/2004)

thanks for such nice article on dropdownlist control . but there is a little bit confusion in hash table. How can i bind the drop down list through hash table. this hash table key and value set through a sql statement.
 
Comment #20  (Posted by Deepak on 02/11/2005)
Rating
Gr8 help for me since i am a beginner...
Good one for beginners...
Thanks..
 
Comment #21  (Posted by an unknown user on 02/18/2005)
Rating
I would like to see an option to view the code in C#
 
Comment #22  (Posted by an unknown user on 03/10/2005)
Rating
I'm glad I found this!
 
Comment #23  (Posted by an unknown user on 03/27/2005)
Rating
becuase it doesnt even tell you how to get get a show the text in the combo box, from specifying a value of the combo box
 
Comment #24  (Posted by an unknown user on 03/28/2005)
Rating
Quite informative...
Covers everything pertaining to a combobox....oops..drop down list!
 
Comment #25  (Posted by an unknown user on 03/28/2005)
Rating
Quite informative...
Covers everything pertaining to a combobox....oops..drop down list!
 
Comment #26  (Posted by an unknown user on 04/18/2005)
Rating
Its really useful for all ASP.Net Users
 
Comment #27  (Posted by an unknown user on 04/18/2005)
Rating
I was looking to see if you select a value from one list, and that value exist on the other list, how can you make that other value be the selected one when the data is bind.
 
Comment #28  (Posted by an unknown user on 04/21/2005)
Rating
The AutoPostBack Property should be nade TRUE. Also, when populating from
the Database, the selectedItem property
does not work.
 
Comment #29  (Posted by an unknown user on 04/21/2005)
Rating
The AutoPostBack Property should be nade TRUE. Also, when populating from
the Database, the selectedItem property
does not work.
 
Comment #30  (Posted by an unknown user on 04/22/2005)
Rating
Very good for thoose transitioning from classic asp to asp.net.
 
Comment #31  (Posted by an unknown user on 04/28/2005)
Rating
Thanks very much, this was exactly what I was looking for!
 
Comment #32  (Posted by Peter Kaufman on 04/29/2005)
Rating
Thanks! That worked perfectly!
 
Comment #33  (Posted by an unknown user on 05/03/2005)
Rating
Solve my problem on understanding ways to put items in drop down list
 
Comment #34  (Posted by an unknown user on 05/23/2005)
Rating
Good one pal :)
 
Comment #35  (Posted by an unknown user on 06/06/2005)
Rating
Rock on dude. Thanks.
 
Comment #36  (Posted by an unknown user on 06/07/2005)
Rating
Great help Thanx a ton
 
Comment #37  (Posted by an unknown user on 06/24/2005)
Rating
simple, clear, gives direct information readily usable. thank you
 
Comment #38  (Posted by an unknown user on 07/03/2005)
Rating
it is good but still did not get the event handling
 
Comment #39  (Posted by sunil sharma on 07/03/2005)
Rating
it's a good stuff but i did not get for what i am looking send me event handling in .net
 
Comment #40  (Posted by an unknown user on 07/22/2005)
Rating
It is a very good article. It helps me to figure out how to get data from dropdown list. But I can only get one row of the data. How can I get all the rows in the table?

Please e-mail me at dinahdu@yahoo.com

Thanks
Dinah
 
Comment #41  (Posted by Devender on 08/10/2005)
Rating
U saved my time
 
Comment #42  (Posted by an unknown user on 08/16/2005)
Rating
Just what the doctor ordered! Thanks!
 
Comment #43  (Posted by an unknown user on 08/17/2005)
Rating
Decent overview (I particularly appreciate the "NOT a ComboBox" mantra), but why on earth would you loop through a datareader instead of using standard .NET databinding?

DropDownList1.DataSource = rdr
DropDownList1.DataValueField = "Field1"
DropDownList1.DataTextField = "Field2"
DropDownList1.DataBind()

 
Comment #44  (Posted by an unknown user on 08/27/2005)
Rating
Good Article
 
Comment #45  (Posted by an unknown user on 09/01/2005)
Rating
~Lets Say you are using .Net and trying to connect do a Access database

Dim myConnectionString, mySelectQuery As String
myConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\temp\Products.mdb"
mySelectQuery = "SELECT ProductName FROM Products "

Dim myConnection As New OleDbConnection(myConnectionString)
Dim myOleDbCommand As New OleDbCommand(mySelectQuery, myConnection)

myOleDbCommand.Connection.Open()
Dim myDataReader As OleDbDataReader = myOleDbCommand.ExecuteReader(CommandBehavior.CloseConnection)


While myDataReader.Read()
Dim newListItem As New ListItem()
newListItem.Text = myDataReader.GetString(0)
DL1.Items.Add(newListItem)
End While

myDataReader.Close()
myConnection.Close()

By Gustavo Matte
 
Comment #46  (Posted by an unknown user on 09/06/2005)
Rating
It is a very good article. it helps me very much.
 
Comment #47  (Posted by an unknown user on 09/06/2005)
Rating
It is a very good article. it helps me very much.
 
Comment #48  (Posted by Prabha on 09/06/2005)
Rating
Hi, Good article. I like to add the databind while clicking the dropdown list, not while loading the page....any suggestion, how to do this?
 
Comment #49  (Posted by an unknown user on 09/18/2005)
Rating
Good article. Thanx!!!!
 
Comment #50  (Posted by an unknown user on 10/21/2005)
Rating
I was trying for this type of code in my application since 3 days. atleast I got it through with the logic used here or shown here
--------------
MONE
 
Comment #51  (Posted by an unknown user on 11/08/2005)
Rating
Oh my good!
My problem is solved
Exactly what I needed
/max from europe
 
Comment #52  (Posted by an unknown user on 11/21/2005)
Rating
Perfect solution thanks !
 
Comment #53  (Posted by JamesDel on 12/02/2005)
Rating
Hi I am trying to use the AutoPostBack function but I'm not sure why I cant refer to the selected value in the combo box when the SelectedIndexChanged code is ran. It seems to reset my form? Thanks in advance!!
 
Comment #54  (Posted by an unknown user on 12/06/2005)
Rating
thx for Manish :)

 
Comment #55  (Posted by an unknown user on 12/13/2005)
Rating
It has an execellent synopsis of a dropdownlist which is difficult to find in a condensed format at a time.
 
Comment #56  (Posted by an unknown user on 12/29/2005)
Rating
nicely placed info
 
Comment #57  (Posted by Vikas Bhatnagar on 01/02/2006)
Rating
It's really good . It helped me a lot. Thanks.....
 
Comment #58  (Posted by as asd asd on 01/06/2006)
Rating
as asdasd
 
Comment #59  (Posted by an unknown user on 01/17/2006)
Rating
This is very informative i like it.
very very thanks
 
Comment #60  (Posted by Asif Nadeem on 01/23/2006)
Rating
Very Nice Article.
what is datatype of item variable while to looping the hashtabl
 
Comment #61  (Posted by D. Robins on 02/16/2006)
Rating
Excellent job!
 
Comment #62  (Posted by an unknown user on 03/01/2006)
Rating
Helps a lot. where would us newbies be without hel like this, lol.
 
Comment #63  (Posted by an unknown user on 03/11/2006)
Rating
Item number 8 (looping thru the datareader) does not work as published. Produces an error: "Specified cast is not valid" This is because you've not shown how to bind the data to the DropDownList. I've tried a number of ways of making this work - none succeeded.

Perhaps you should post an actual working sample with these articles to make sure that the code you post works?!
 
Comment #64  (Posted by an unknown user on 03/19/2006)
Rating
Well, everybody new that, but how does it work if you making an array of Listitems that you return from a function and then bind it to the dropdownlist. Both text and value of the dropdownlist get the .Text value from the arrary of Listitems. This seems like a bug in dotnet.

Kind regards,
jona@spama.no
 
Comment #65  (Posted by an unknown user on 03/26/2006)
Rating
wow this is great
 
Comment #66  (Posted by an unknown user on 03/30/2006)
Rating
i cant find what i wanted
 
Comment #67  (Posted by an unknown user on 04/08/2006)
Rating
the explanation is very good, & the way it is written , everything get understood.
 
Comment #68  (Posted by an unknown user on 04/12/2006)
Rating
Excellent
 
Comment #69  (Posted by an unknown user on 04/21/2006)
Rating
This article is pretty much the same as every other article describing a dropdownlist. As some comments state it does not tell us how to set the selected value after the list is populated and this has been my biggest problem with it so far!
 
Comment #70  (Posted by an unknown user on 04/21/2006)
Rating
This article is pretty much the same as every other article describing a dropdownlist. As some comments state it does not tell us how to set the selected value after the list is populated and this has been my biggest problem with it so far!
 
Comment #71  (Posted by an unknown user on 04/24/2006)
Rating
First good example I've seen on building list from SQL Server results
 
Comment #72  (Posted by an unknown user on 04/25/2006)
Rating
Great code examples, short and to the point text. I went here for help with populating the DropDownList and bam - there it was; and even gave me a few new ideas!
 
Comment #73  (Posted by an unknown user on 04/27/2006)
Rating
Nice Article ... Very thankful to u
 
Comment #74  (Posted by an unknown user on 05/07/2006)
Rating
not complete
 
Comment #75  (Posted by an unknown user on 05/16/2006)
Rating
very good
 
Comment #76  (Posted by an unknown user on 05/25/2006)
Rating
This was a great help. Thank you!

 
Comment #77  (Posted by an unknown user on 05/27/2006)
Rating
it is so nice.thank u very much
 
Comment #78  (Posted by an unknown user on 05/30/2006)
Rating
It's a very good article
 
Comment #79  (Posted by an unknown user on 06/01/2006)
Rating
Article was good...thanks to Manish for the solution to setting the index I was looking for!
 
Comment #80  (Posted by an unknown user on 06/15/2006)
Rating
Sweet! Shows what I need very clearly.
 
Comment #81  (Posted by an unknown user on 07/28/2006)
Rating
I got the answer to what i was looking in moments. Thats what counts when u are searching for stuff!! Thanks. Well put!
 
Comment #82  (Posted by an unknown user on 08/28/2006)
Rating
Very strait forward and cover various forms of usage
 
Comment #83  (Posted by Janet on 08/28/2006)
Rating
Thanks! Is there an easy way to search on more than the first character typed in? For instance if I have 0001 and 0020 in my list, as the user types 0 and then 0 and then 2 it would go to the second item.
 
Comment #84  (Posted by an unknown user on 09/13/2006)
Rating
Thanks worked for me
-yusuff
 
Comment #85  (Posted by an unknown user on 09/18/2006)
Rating
Excellent! This helps me a lot!

 
Comment #86  (Posted by an unknown user on 09/20/2006)
Rating
You should also describe its methods and events
 
Comment #87  (Posted by Pratik on 11/09/2006)
Rating
i like all the example.but if you given executable example then it will help new users.
 
Comment #88  (Posted by an unknown user on 11/21/2006)
Rating
very nice examples
 
Comment #89  (Posted by an unknown user on 12/04/2006)
Rating
excellent example
 
Comment #90  (Posted by an unknown user on 12/13/2006)
Rating
excellent
 
Comment #91  (Posted by an unknown user on 12/13/2006)
Rating
Very well described. Thanks :)
 
Comment #92  (Posted by an unknown user on 03/29/2007)
Rating
excellent work keep it up.
 
Comment #93  (Posted by an unknown user on 05/22/2007)
Rating
hi all i made a user control with some dropdown lists n set the tabidexes correspondingly but while using this control at main page it dint show the proper tab index. olz help me wt to do.
Anand
 
Comment #94  (Posted by an unknown user on 06/26/2007)
Rating
It's good, using this code i could solve my problem immedietely.
 
Comment #95  (Posted by an unknown user on 07/13/2007)
Rating
good thts y
 
Comment #96  (Posted by an unknown user on 07/26/2007)
Rating
great dude
 
Comment #97  (Posted by an unknown user on 08/01/2007)
Rating
gooooooooooood !
 
Comment #98  (Posted by an unknown user on 08/17/2007)
Rating
very to the point and exaclty what I spent a long time searching for.

Thank you for compiling this article.
 
Comment #99  (Posted by an unknown user on 10/14/2007)
Rating
Thanks , it's realy very good artical
 
Comment #100  (Posted by an unknown user on 10/15/2007)
Rating
would like to see C# solution as well as VB, Thanks
 
Comment #101  (Posted by an unknown user on 10/23/2007)
Rating
google pulls this page up with a search of 'asp.net c# dropdownlist'.. no c# code here :(
 
Comment #102  (Posted by hylwukukev on 12/10/2007)
Rating
Hello! Good Site! Thanks you! qihzoktfbwn
 
Comment #103  (Posted by an unknown user on 12/14/2007)
Rating
At least a tutorial page very CLEAR
 
Comment #104  (Posted by an unknown user on 12/17/2007)
Rating
Very clear, a model of what tech writers should strive for. You can't possibly cover everyone's special case, so don't worry about it.
 
Comment #105  (Posted by an unknown user on 02/16/2008)
Rating
this is an excellent site .i always get solved my doubts after visiting this site.
 
Comment #106  (Posted by an unknown user on 03/04/2008)
Rating
This article helped me to get knowledge on DropDownList in a GridView.Thank you
 
Comment #107  (Posted by kate on 03/06/2008)
Rating
for the c# folks out there, the use of a hashtable was a great insight for me - here's how it worked for my implementation:

Hashtable myHashTable = new Hashtable();

myHashTable.Add("NY", "New York");
myHashTable.Add("NJ", "New Jersey");

foreach (DictionaryEntry de in myHashTable)
{
ListItem listitem = new ListItem();
listitem.Text = de.Value.ToString();
listitem.Value = de.Key.ToString();
ddMyDropDown.Items.Add(listitem);
}
 
Comment #108  (Posted by an unknown user on 03/07/2008)
Rating
very poor example...waste one...
 
Comment #109  (Posted by an unknown user on 04/03/2008)
Rating
Excellent
 
Comment #110  (Posted by an unknown user on 04/08/2008)
Rating
good
 
Comment #111  (Posted by an unknown user on 04/16/2008)
Rating
I'd been looking for this simple piece of code everywhere to try and understand the method.
I too have been programming in VB6 for over a decade and was at the same place in thought!!
 
Comment #112  (Posted by an unknown user on 06/07/2008)
Rating
iaz475xp3zezb0 wyk21xg07x32 u45nkuirojxtqj06b
 
Comment #113  (Posted by letoviacelm on 07/29/2008)
Rating
nocovial
 
Comment #114  (Posted by an unknown user on 09/14/2008)
Rating
Good overview
 
Comment #115  (Posted by an unknown user on 10/16/2008)
Rating
No examples of manipulating and using the selected option after the control is created.
 
Comment #116  (Posted by an unknown user on 11/10/2008)
Rating
its gud but plz provide us in C#
 
Comment #117  (Posted by an unknown user on 11/10/2008)
Rating
its gud but plz provide us in C#
 
Comment #118  (Posted by an unknown user on 02/09/2009)
Rating
Good morning. Never make a defense or an apology until you are accused.
I am from Myanmar and also am speaking English, give please true I wrote the following sentence: "How to start a business a lot of work goes into starting a business before how to start a business."

Regards :p Cassia.
 
Comment #119  (Posted by an unknown user on 05/22/2009)
Rating
The SQL section helped me. Thanks
 
Comment #120  (Posted by an unknown user on 07/23/2009)
Rating
All in a nut shell about ddl.
Thx you m8.
 
Comment #121  (Posted by an unknown user on 08/16/2009)
Rating
I was having nothing but trouble with databinding a dropdown list to a dataset. I tried the datareader/additem way and it worked perfectly. Thanks.
 
Comment #122  (Posted by an unknown user on 09/03/2009)
Rating
Very clear, concise and showed examples of code. Great job!
 
Comment #123  (Posted by on 10/11/2009)
Rating

 
Comment #124  (Posted by an unknown user on 10/15/2009)
Rating
Low down implies you are giving me the inside scoop! You never showed me the control or told me about autopostback="true"
 
Comment #125  (Posted by an unknown user on 11/19/2009)
Rating
This is only half the story - getting items in is one thing but there is no documentation anywhere that I can find that tells how to get at the vlue in the DataValueField based on the SelectedIndexChanged event.
 
Comment #126  (Posted by an unknown user on 11/20/2009)
Rating
I was struggling with populating the value using databinding - clear fix well presented! Thanks!
 
Comment #127  (Posted by an unknown user on 06/28/2010)
Rating
Good Job
 
Comment #128  (Posted by an unknown user on 04/28/2011)
Rating
Easiest solution I've found for populating dropdown lists with Text vs Values.
 
Comment #129  (Posted by Buy cheap OEM software on 09/28/2011)
Rating
NP1knS Stupid article..!
 
Comment #130  (Posted by oem software on 02/12/2012)
Rating
ePMIFV Hooray! the one who wrote is a cool guy..!!
 
Comment #131  (Posted by Microsoft OEM Software on 03/07/2012)
Rating
qDeCex Looking forward to reading more. Great blog.Thanks Again. Really Cool.
 
Comment #132  (Posted by jacksonville web solutions on 04/18/2012)
Rating
21xzQd Enjoyed every bit of your blog.Really thank you! Really Cool.
 
Comment #133  (Posted by Bristol Airport Hotels on 04/18/2012)
Rating
zgxHaX I cannot thank you enough for the blog. Fantastic.
 
Sponsored Links