Tag Archives: DropDownList

Bind Generic List to ASP.NET DropDownList Example

Let us suppose you had a simple class of tags that you wanted to bind to an ASP.NET DropDownList control. public class TagDetails { private int tagID; public int TagID { get { return tagID; } } private string tagName; … Continue reading

Posted in ASP.NET | Tagged , | 1 Comment

Add Item to DropDownList After DataBind

We often want the first option in a drop-down list to not default to the first item in the list. Instead we would prefer the option of adding a –Select Item– at the top of the asp:DropDownList. After the DataBind, … Continue reading

Posted in ASP.NET | Tagged , | Comments Off

SortedList Example for ASP.NET in C#

The SortedList object uses a key/value combination to sort a list. The SortedList can be databound to the following ASP.NET controls: asp:RadioButtonList asp:CheckBoxList asp:DropDownList asp:ListBox Our examples will bind a SortedList to an asp:ListBox. <asp:ListBox ID=”lsbPresidents” runat=”server” /> Numeric Sort … Continue reading

Posted in C#, VB.NET | Tagged , , , , | Comments Off