Return to Snippet

Revision: 4956
at January 30, 2008 22:13 by rengber


Initial Code
private void PopulateLookupData()
    {
        Lookup.SuburbDataTable subs = DALLookup.GetSuburbs();
        dropSuburb.DataSource = subs;
        dropSuburb.DataTextField = subs.SuburbColumn.ColumnName;
        dropSuburb.DataValueField = subs.SuburbIdColumn.ColumnName;
        dropSuburb.DataBind(); 
        dropSuburb.Items.Insert(0, new ListItem("Select a Suburb.")); 
    }

Initial URL

                                

Initial Description
Stupidly simple, but I keep forgetting it.

Initial Title
Adding another item to a databound drop-down list.

Initial Tags
simple

Initial Language
C#